File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed
libraries/ESP32/examples/Time/SimpleTime Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,14 @@ void setup()
3333{
3434 Serial.begin (115200 );
3535
36- // configure WiFi STA and connect in order to get the current time and date.
36+ // First step is to configure WiFi STA and connect in order to get the current time and date.
37+ Serial.printf (" Connecting to %s " , ssid);
3738 WiFi.begin (ssid, password);
39+ while (WiFi.status () != WL_CONNECTED) {
40+ delay (500 );
41+ Serial.print (" ." );
42+ }
43+ Serial.println (" CONNECTED" );
3844
3945 // set notification call-back function
4046 sntp_set_time_sync_notification_cb ( timeavailable );
@@ -62,16 +68,6 @@ void setup()
6268 * A list of rules for your zone could be obtained from https://github.com/esp8266/Arduino/blob/master/cores/esp8266/TZ.h
6369 */
6470 // configTzTime(time_zone, ntpServer1, ntpServer2);
65-
66- // connect to WiFi
67- Serial.printf (" Connecting to %s " , ssid);
68- WiFi.begin (ssid, password);
69- while (WiFi.status () != WL_CONNECTED) {
70- delay (500 );
71- Serial.print (" ." );
72- }
73- Serial.println (" CONNECTED" );
74-
7571}
7672
7773void loop ()
You can’t perform that action at this time.
0 commit comments