Skip to content

Commit 751ab8f

Browse files
author
oclyke
committed
fix Example3
1 parent 2656e07 commit 751ab8f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

libraries/RTC/examples/Example3_Test_RTC/Example3_Test_RTC.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include "RTC.h"
1010
APM3_RTC myRTC; // Create instance of RTC class
1111

12-
int previousDay = 1;
12+
int previousDay;
1313

1414
void setup()
1515
{
@@ -19,15 +19,17 @@ void setup()
1919

2020
// Manually set RTC date and time
2121
myRTC.setTime(23, 59, 59, 0, 1, 1, 20); // Set to 1 second before midnight
22+
myRTC.getTime();
2223
}
2324

2425
void loop()
2526
{
26-
printArtemisTime();
27-
28-
myRTC.getTime();
2927
myRTC.setTime(23, 59, 59, 99, myRTC.dayOfMonth, myRTC.month, myRTC.year); // Manually set RTC
28+
myRTC.getTime();
29+
previousDay = myRTC.weekday;
3030
delay(11); //Allow us to roll from midnight the night before to the new day
31+
32+
printArtemisTime();
3133
}
3234

3335
void printArtemisTime()
@@ -77,7 +79,5 @@ void printArtemisTime()
7779
;
7880
}
7981

80-
previousDay = myRTC.weekday;
81-
8282
Serial.println();
83-
}
83+
}

0 commit comments

Comments
 (0)