Skip to content

Commit e691f2f

Browse files
committed
Update RTC alarm comparisons
1 parent ebb80e5 commit e691f2f

File tree

3 files changed

+30
-25
lines changed

3 files changed

+30
-25
lines changed

libraries/RTC/examples/Example2_Set_Alarms/Example2_Set_Alarms.ino

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,15 @@
33
Created: June 3rd, 2020
44
License: MIT. See SparkFun Arduino Apollo3 Project for more information
55
6-
This example demonstrates how to read and set the RTC alarms. The code is
7-
configured so that the RTC alarm will trigger every minute. The RTC interrupt
8-
service routine will set an alarm flag each time the alarm triggers and the
9-
RTC date and time will printed to the Serial Monitor.
6+
This example demonstrates how to read and set the RTC alarms.
7+
8+
It is necessary to first set the RTC alarm date and time and then specify
9+
the alarm mode, which determines which date and time values will be used
10+
for comparison when generating an alarm interrupt.
11+
12+
The code is configured so that the RTC alarm will trigger every minute.
13+
The RTC interrupt service routine will set an alarm flag each time the
14+
alarm triggers and the RTC date and time will printed to the Serial Monitor.
1015
*/
1116

1217
#include "RTC.h" // Include RTC library included with the Aruino_Apollo3 core
@@ -31,13 +36,13 @@ void setup()
3136
// Set the RTC alarm mode
3237
/*
3338
0: Alarm interrupt disabled
34-
1: Alarm match every year
35-
2: Alarm match every month
36-
3: Alarm match every week
37-
4: Alarm match every day
38-
5: Alarm match every hour
39-
6: Alarm match every minute
40-
7: Alarm match every second
39+
1: Alarm match every year (hundredths, seconds, minutes, hour, day, month)
40+
2: Alarm match every month (hundredths, seconds, minutes, hours, day)
41+
3: Alarm match every week (hundredths, seconds, minutes, hours, weekday)
42+
4: Alarm match every day (hundredths, seconds, minute, hours)
43+
5: Alarm match every hour (hundredths, seconds, minutes)
44+
6: Alarm match every minute (hundredths, seconds)
45+
7: Alarm match every second (hundredths)
4146
*/
4247
myRTC.setAlarmMode(6); // Set the RTC alarm to match on minutes rollover
4348
myRTC.attachInterrupt(); // Attach RTC alarm interrupt

libraries/RTC/examples/Example5_Rolling_Alarms/Example5_Rolling_Alarms.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ void setup()
3636
// Set the RTC alarm mode
3737
/*
3838
0: Alarm interrupt disabled
39-
1: Alarm match every year
40-
2: Alarm match every month
41-
3: Alarm match every week
42-
4: Alarm match every day
43-
5: Alarm match every hour
44-
6: Alarm match every minute
45-
7: Alarm match every second
39+
1: Alarm match every year (hundredths, seconds, minutes, hour, day, month)
40+
2: Alarm match every month (hundredths, seconds, minutes, hours, day)
41+
3: Alarm match every week (hundredths, seconds, minutes, hours, weekday)
42+
4: Alarm match every day (hundredths, seconds, minute, hours)
43+
5: Alarm match every hour (hundredths, seconds, minutes)
44+
6: Alarm match every minute (hundredths, seconds)
45+
7: Alarm match every second (hundredths)
4646
*/
4747
myRTC.setAlarmMode(6); // Set the RTC alarm to match on minutes rollover
4848
myRTC.attachInterrupt(); // Attach RTC alarm interrupt

libraries/RTC/examples/Example6_LowPower_Alarm/Example6_LowPower_Alarm.ino

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ void setup()
3232
// Set the RTC alarm mode
3333
/*
3434
0: Alarm interrupt disabled
35-
1: Alarm match every year
36-
2: Alarm match every month
37-
3: Alarm match every week
38-
4: Alarm match every day
39-
5: Alarm match every hour
40-
6: Alarm match every minute
41-
7: Alarm match every second
35+
1: Alarm match every year (hundredths, seconds, minutes, hour, day, month)
36+
2: Alarm match every month (hundredths, seconds, minutes, hours, day)
37+
3: Alarm match every week (hundredths, seconds, minutes, hours, weekday)
38+
4: Alarm match every day (hundredths, seconds, minute, hours)
39+
5: Alarm match every hour (hundredths, seconds, minutes)
40+
6: Alarm match every minute (hundredths, seconds)
41+
7: Alarm match every second (hundredths)
4242
*/
4343
myRTC.setAlarmMode(6); // Set the RTC alarm to match on minutes rollover
4444
myRTC.attachInterrupt(); // Attach RTC alarm interrupt

0 commit comments

Comments
 (0)