travel

<?xml encoding="utf-8" ?><p>ESP32 NTP Example.ino</p><p>by&nbsp;<a href="https://wokwi.com/makers/urish" target="_blank" rel=" noopener">urish</a></p><p><a href="https://docs.wokwi.com/?utm_source=wokwi" target="_blank" rel=" noopener">Docs</a></p><p>ESP32 NTP Example.inodiagram.jsonlibraries.txtLibrary Manager</p><pre> <code>// Learn about the ESP32 WiFi simulation in // https://docs.wokwi.com/guides/esp32-wifi #include &lt;WiFi.h&gt; #include &lt;Wire.h&gt; #include &lt;LiquidCrystal_I2C.h&gt; LiquidCrystal_I2C LCD = LiquidCrystal_I2C(0x27, 16, 2); #define NTP_SERVER "pool.ntp.org" #define UTC_OFFSET 0 #define UTC_OFFSET_DST 0 void spinner() { static int8_t counter = 0; const char* glyphs = "\xa1\xa5\xdb"; LCD.setCursor(15, 1); LCD.print(glyphs[counter++]); if (counter == strlen(glyphs)) { counter = 0; } } void printLocalTime() { struct tm timeinfo; if (!getLocalTime(&amp;timeinfo)) { LCD.setCursor(0, 1); LCD.println("Connection Err"); return; } LCD.setCursor(8, 0); LCD.println(&amp;timeinfo, "%H:%M:%S"); LCD.setCursor(0, 1); LCD.println(&amp;timeinfo, "%d/%m/%Y %Z"); } void setup() { Serial.begin(115200); LCD.init(); LCD.backlight(); LCD.setCursor(0, 0); LCD.print("Connecting to "); LCD.setCursor(0, 1); LCD.print("WiFi "); WiFi.begin("Wokwi-GUEST", "", 6); while (WiFi.status() != WL_CONNECTED) { delay(250); spinner(); } Serial.println(""); Serial.println("WiFi connected"); Serial.print("IP address: "); Serial.println(WiFi.localIP()); LCD.clear(); LCD.setCursor(0, 0); LCD.println("Online"); LCD.setCursor(0, 1); LCD.println("Updating time..."); configTime(UTC_OFFSET, UTC_OFFSET_DST, NTP_SERVER); } void loop() { printLocalTime(); delay(250); } </code></pre><p>Simulation</p><p>Loading<br> esp32-devkit-c-v4</p><p>1&nbsp;GND&nbsp;VCC&nbsp;SDA&nbsp;SCL</p><p>&nbsp;</p>