File tree 1 file changed +7
-11
lines changed
libraries/ESP32/examples/Time/SimpleTime
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -33,8 +33,14 @@ void setup()
33
33
{
34
34
Serial.begin (115200 );
35
35
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);
37
38
WiFi.begin (ssid, password);
39
+ while (WiFi.status () != WL_CONNECTED) {
40
+ delay (500 );
41
+ Serial.print (" ." );
42
+ }
43
+ Serial.println (" CONNECTED" );
38
44
39
45
// set notification call-back function
40
46
sntp_set_time_sync_notification_cb ( timeavailable );
@@ -62,16 +68,6 @@ void setup()
62
68
* A list of rules for your zone could be obtained from https://github.com/esp8266/Arduino/blob/master/cores/esp8266/TZ.h
63
69
*/
64
70
// 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
-
75
71
}
76
72
77
73
void loop ()
You can’t perform that action at this time.
0 commit comments