WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit e45292b

Browse files
authored
Read time from RTC
Read the time value from the RTC. This ensures that the RTC holds the correct values for 48H after removing the power.
1 parent 2ad4598 commit e45292b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/RTC/RTC.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void loop() {
6262
Serial.print(":");
6363
Serial.println(MachineControl_RTCController.getSeconds());
6464

65-
time_t utc_time = time(NULL);
65+
time_t utc_time = MachineControl_RTCController.getEpoch();
6666
Serial.print("Date as UTC time: ");
6767
Serial.println(utc_time);
6868
Serial.println();

0 commit comments

Comments
 (0)