#include <WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP, "asia.pool.ntp.org", 28800, 60000);
// Wifi network station credentials
//#define WIFI_SSID "Wokwi-GUEST"
//#define WIFI_PASSWORD ""
const char *ssid = "Wokwi-GUEST";
const char *password = "";
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
WiFi.begin(ssid, password);
while ( WiFi.status() != WL_CONNECTED ) {
delay ( 500 );
Serial.print ( "." );
}
timeClient.begin();
delay(1000);
Serial.println("lab 1 v1 ");//serial comm write
Serial.println("By Nasrul_2021 ");//serial comm write
}
void loop() {
timeClient.update();
Serial.println(timeClient.getFormattedTime());
delay(1000);
}