Arduino Nodemcu ESP8266 Digital Clock with OLED 0.91 inch display

Описание к видео Arduino Nodemcu ESP8266 Digital Clock with OLED 0.91 inch display

In Arduino programming using the ESP8266 based NodeMCU board interfaced with 0.91 inch OLED screen we implemnted the digital Clock using two methods. One is simple by using the Arduino built in millis() function to create the time based on some starting time.
Second is to use the API call to worlds api for fetching my Karachi/Pakistan time zone. It returns the json data like this
{
"abbreviation": "PKT",
"client_ip": "119.158.45.117",
"datetime": "2023-09-11T20:47:25.294587+05:00",
"day_of_week": 1,
"day_of_year": 254,
"dst": false,
"dst_from": null,
"dst_offset": 0,
"dst_until": null,
"raw_offset": 18000,
"timezone": "Asia/Karachi",
"unixtime": 1694447245,
"utc_datetime": "2023-09-11T15:47:25.294587+00:00",
"utc_offset": "+05:00",
"week_number": 37
}

We parsed this json and then created a function which takes the time string and fetch hour: minutes : seconds from it and in our loop() function of arduino code we display that time to the OLED 0.91 inch display.
We used Adafruit_SSD1306 and Adafruit_GFX library. Becuase we are interfacing the esp8266 with oled using the i2c protocole we also need to get the address which is 0x3c for this oled and I used that like this
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 32
#define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C
full complete tutorial and code is available in my blog
https://www.fypsolutions.com/examples...

Комментарии

Информация по комментариям в разработке