working RTC

This commit is contained in:
Siwat Sirichai 2023-09-16 16:44:07 +07:00
parent a927c74393
commit 63d9bfb524
4 changed files with 60 additions and 6 deletions

View file

@ -1,8 +1,12 @@
#include <ESPMegaPRO.h>
void setup() {
ESPMega_begin();
Serial.begin(115200);
ESPMega_setTime(16,35,0,16,9,2023);
}
void loop() {
delay(5000);
delay(1000);
rtctime_t tm = ESPMega_getTime();
Serial.printf("%02d:%02d:%02d %02d/%02d/%04d\n", tm.hours,tm.minutes,tm.seconds,tm.day,tm.month,tm.year);
}