Skip to content

Commit 4369a06

Browse files
fixup! added example for proper usage of RTC reset
1 parent d9ca706 commit 4369a06

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

libraries/RTC/examples/RTC_Reset/RTC_Reset.ino

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
/*
2-
* RTC_AutomaticExample
2+
* RTC_Reset
33
*
4-
* This example sets the RTC (Real Time Clock) on the Portenta C33 automatically by
5-
* retrieving the date and time from the computer you upload the sketch from, at the
6-
* point when you start the upload.
7-
*
8-
* Next, it gets the current time from the RTC and prints it to the Serial Monitor.
9-
* It then sets an RTC alarm to fire every time the seconds value of the time is zero.
10-
* The alarm, which now goes off once a minute, triggers a callback that prints the
11-
* current time to the Serial Monitor.
4+
* This example sets the RTC with __TIMESTAMP__ macro and can be used to test whether the settings of
5+
* RTC persists after a reset or when VRTC is powered. If VRTC is powered I can disconnect the board
6+
* from the usb cable and the RTC value will persist
127
*
138
* Find the full UNO R4 WiFi RTC documentation here:
149
* https://docs.arduino.cc/tutorials/uno-r4-wifi/rtc
@@ -148,7 +143,7 @@ void setup()
148143
// Initialize the RTC
149144
RTC.begin();
150145

151-
// Get the current date and time when the sketch is uploaded and set the RTC
146+
// if the RTC is not running set its value to the compile time __TIMESTAMP__ macro
152147
if(!RTC.isRunning()) {
153148
RTCTime timeToSet = currentRTCTime();
154149
RTC.setTime(timeToSet);

0 commit comments

Comments
 (0)