Skip to content

Commit

Permalink
Add time zone as a variable in ESP8266 example
Browse files Browse the repository at this point in the history
  • Loading branch information
gmag11 committed May 1, 2017
1 parent 658d1ed commit 5ff73d6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion examples/NTPClientESP8266/NTPClientESP8266.ino
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,12 @@ CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE G

#define ONBOARDLED 2 // Built in LED on ESP-12/ESP-07

int8_t timeZone = 1;

// Start NTP only after IP network is connected
void onSTAGotIP(WiFiEventStationModeGotIP ipInfo) {
Serial.printf("Got IP: %s\r\n", ipInfo.ip.toString().c_str());
NTP.begin("pool.ntp.org", 1, true);
NTP.begin("pool.ntp.org", timeZone, true);
NTP.setInterval(63);
digitalWrite(ONBOARDLED, LOW); // Turn on LED
}
Expand Down

0 comments on commit 5ff73d6

Please sign in to comment.