-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
24 hour percentage // manual? #3
Comments
@Tenderlaan54 Hi! Thanks for checking out this project. Yeah, as of right now it is manual. If you're interested, you could look into something like this https://randomnerdtutorials.com/esp8266-nodemcu-date-time-ntp-client-server-arduino/ to help get the date and generate the string to put in for the lookup. If you do, please submit a merge request and I'd be more than happy to add your code to the project! |
I tried but I can't get the correct format of the date. The format in the link you gave is: 2021-8-3 instead of 2021-08-03. Isn't it possible and easier to get this info from the api call? |
I don't know how to submit a merge request. So i will post my code here below. ////// my library ////// ///// The code i use ///// #include <Adafruit_SSD1306.h> //const char* ssid = SECRET_SSID; const char* ssid = "SECRET_SSID"; const long utcOffsetInSeconds = -28800; // Powered by CoinDesk - https://www.coindesk.com/price/bitcoin // 'icons8-bitcoin-24', 24x24px HTTPClient http; WiFiUDP ntpUDP; void setup() {
// Set offset time in seconds to adjust for your timezone, for example: if (!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)) { display.clearDisplay(); WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) Serial.print("CONNECTED to SSID: "); display.print("Connected to "); void loop() { timeClient.update(); if (WiFi.status() == WL_CONNECTED) {
// display.clearDisplay();
} void printCenter(const String buf, int x, int y) |
Maybe not a issue, but do you have to change this code each day to get the right percentage in the code below?
//Display 24hr. Percent Change
double yesterdayPrice = historyDoc["bpi"]["2021-03-20"].as();
The text was updated successfully, but these errors were encountered: