You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/10.mega/boards/giga-r1-wifi/tutorials/cheat-sheet/cheat-sheet.md
+2-3Lines changed: 2 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -572,14 +572,13 @@ void printWifiStatus()
572
572
Serial.println(" dBm");
573
573
}
574
574
```
575
-
576
575
### RTC / UDP / NTP Example (Timezone)
577
576
578
577
This example provides an option to set the timezone. As the received epoch is based on GMT time, you can input e.g. `-1` or `5` which represents the hours. The `timezone` variable is changed at the top of the example.
579
578
580
579
```arduino
581
580
/*
582
-
Udp NTP Client
581
+
Udp NTP Client with Timezone Adjustment
583
582
584
583
Get the time from a Network Time Protocol (NTP) time server
585
584
Demonstrates use of UDP sendPacket and ReceivePacket
@@ -703,7 +702,7 @@ unsigned long parseNtpPacket() {
703
702
constexpr unsigned long seventyYears = 2208988800UL;
704
703
const unsigned long epoch = secsSince1900 - seventyYears;
705
704
706
-
new_epoch = epoch + (3600 * timezone); //multiply the timezone with 3600 (1 hour)
705
+
const unsigned long new_epoch = epoch + (3600 * timezone); //multiply the timezone with 3600 (1 hour)
0 commit comments