first working version

This commit is contained in:
Dmitry Borisenko
2019-12-24 11:53:26 +03:00
parent af4715c895
commit 0c6cb1719f
101 changed files with 5567 additions and 0 deletions

20
Time_esp32.ino Normal file
View File

@@ -0,0 +1,20 @@
#ifdef ESP32
void Time_Init() {
//init and get the time
configTime(gmtOffset_sec, daylightOffset_sec, ntpServer);
printLocalTime();
}
void printLocalTime() {
struct tm timeinfo;
if (!getLocalTime(&timeinfo)) {
Serial.println("[E] Failed to obtain time");
return;
}
Serial.println(&timeinfo, "[V] %A, %B %d %Y %H:%M:%S");
}
#endif