File tree Expand file tree Collapse file tree 7 files changed +184
-129
lines changed Expand file tree Collapse file tree 7 files changed +184
-129
lines changed Original file line number Diff line number Diff line change 7
7
8
8
http://arduino.cc/en/Tutorial/SimpleRTC
9
9
10
+ created by Arturo Guadalupi <[email protected] >
11
+ 15 Jun 2015
12
+
13
+ modified
14
+ 21 Oct 2015
10
15
*/
11
16
12
17
#include < RTCZero.h>
@@ -28,7 +33,7 @@ void setup()
28
33
{
29
34
Serial.begin (9600 );
30
35
31
- rtc.begin (H24 ); // initialize RTC 24H format. The dual option is H12
36
+ rtc.begin (); // initialize RTC
32
37
33
38
// Set the time
34
39
rtc.setHours (hours);
Original file line number Diff line number Diff line change
1
+ /*
2
+ Simple RTC Alarm for Arduino Zero
3
+
4
+ Demonstrates the use of alarms using the RTC library for the Arduino Zero
5
+
6
+ This example code is in the public domain
7
+
8
+ http://arduino.cc/en/Tutorial/SimpleRTCAlarm
9
+
10
+ created by Arturo Guadalupi <[email protected] >
11
+ 25 Sept 2015
12
+
13
+ modified
14
+ 21 Oct 2015
15
+ */
16
+
17
+ #include < RTCZero.h>
18
+
19
+ /* Create an rtc object */
20
+ RTCZero rtc;
21
+
22
+ /* Change these values to set the current initial time */
23
+ const uint8_t seconds = 0 ;
24
+ const uint8_t minutes = 0 ;
25
+ const uint8_t hours = 16 ;
26
+
27
+ /* Change these values to set the current initial date */
28
+ const uint8_t day = 25 ;
29
+ const uint8_t month = 9 ;
30
+ const uint8_t year = 15 ;
31
+
32
+ void setup ()
33
+ {
34
+ Serial.begin (9600 );
35
+
36
+ rtc.begin (); // initialize RTC 24H format
37
+
38
+ rtc.setTime (hours, minutes, seconds);
39
+ rtc.setDate (day, month, year);
40
+
41
+ rtc.setAlarmTime (16 , 0 , 10 );
42
+ rtc.enableAlarm (rtc.MATCH_HHMMSS );
43
+
44
+ rtc.attachInterrupt (alarmMatch);
45
+ }
46
+
47
+ void loop ()
48
+ {
49
+
50
+ }
51
+
52
+ void alarmMatch ()
53
+ {
54
+ Serial.println (" Alarm Match!" );
55
+ }
Original file line number Diff line number Diff line change
1
+ /*
2
+ Simple RTC Alarm for Arduino Zero
3
+
4
+ Demonstrates the use an alarm to wake up an Arduino zero from Standby mode
5
+
6
+ This example code is in the public domain
7
+
8
+ http://arduino.cc/en/Tutorial/SleepRTCAlarm
9
+
10
+ created by Arturo Guadalupi
11
+ 17 Nov 2015
12
+ */
13
+
14
+ #include < RTCZero.h>
15
+
16
+ /* Create an rtc object */
17
+ RTCZero rtc;
18
+
19
+ /* Change these values to set the current initial time */
20
+ const uint8_t seconds = 0 ;
21
+ const uint8_t minutes = 00 ;
22
+ const uint8_t hours = 17 ;
23
+
24
+ /* Change these values to set the current initial date */
25
+ const uint8_t day = 17 ;
26
+ const uint8_t month = 11 ;
27
+ const uint8_t year = 15 ;
28
+
29
+ void setup ()
30
+ {
31
+ Serial.begin (115200 );
32
+
33
+ rtc.begin ();
34
+
35
+ rtc.setTime (hours, minutes, seconds);
36
+ rtc.setDate (day, month, year);
37
+
38
+ rtc.setAlarmTime (17 , 00 , 10 );
39
+ rtc.enableAlarm (rtc.MATCH_HHMMSS );
40
+
41
+ rtc.attachInterrupt (alarmMatch);
42
+
43
+ rtc.standbyMode ();
44
+ }
45
+
46
+ void loop ()
47
+ {
48
+
49
+ Serial.println (" Awake!" );
50
+
51
+ for (int i = 0 ; i < 10 ; i++)
52
+ Serial.print (i);
53
+
54
+ Serial.println ();
55
+
56
+ Serial.println (" Done! Goodnight!" );
57
+
58
+ rtc.standbyMode (); // Sleep until next alarm match
59
+ }
60
+
61
+ void alarmMatch ()
62
+ {
63
+
64
+ }
Original file line number Diff line number Diff line change @@ -12,23 +12,43 @@ RTCZero KEYWORD1
12
12
# Methods and Functions (KEYWORD2)
13
13
#######################################
14
14
15
- getDay KEYWORD2
16
- getMonth KEYWORD2
17
- getYear KEYWORD2
18
- getHours KEYWORD2
19
- getMinutes KEYWORD2
20
- getSeconds KEYWORD2
15
+ getDay KEYWORD2
16
+ getMonth KEYWORD2
17
+ getYear KEYWORD2
18
+ getHours KEYWORD2
19
+ getMinutes KEYWORD2
20
+ getSeconds KEYWORD2
21
21
22
- setDay KEYWORD2
23
- setMonth KEYWORD2
24
- setYear KEYWORD2
25
- setHours KEYWORD2
26
- setMinutes KEYWORD2
27
- setSeconds KEYWORD2
22
+ setDay KEYWORD2
23
+ setMonth KEYWORD2
24
+ setYear KEYWORD2
25
+ setHours KEYWORD2
26
+ setMinutes KEYWORD2
27
+ setSeconds KEYWORD2
28
+ setDate KEYWORD2
29
+ setTime KEYWORD2
30
+
31
+ getAlarmDay KEYWORD2
32
+ getAlarmMonth KEYWORD2
33
+ getAlarmYear KEYWORD2
34
+ getAlarmHours KEYWORD2
35
+ getAlarmMinutes KEYWORD2
36
+ getAlarmSeconds KEYWORD2
37
+
38
+ setAlarmDay KEYWORD2
39
+ setAlarmMonth KEYWORD2
40
+ setAlarmYear KEYWORD2
41
+ setAlarmHours KEYWORD2
42
+ setAlarmMinutes KEYWORD2
43
+ setAlarmSeconds KEYWORD2
44
+ setAlarmDate KEYWORD2
45
+ setAlarmTime KEYWORD2
46
+
47
+ enableAlarm KEYWORD2
48
+ disableAlarm KEYWORD2
49
+
50
+ standbyMode KEYWORD2
28
51
29
52
#######################################
30
53
# Constants (LITERAL1)
31
54
#######################################
32
- H24 LITERAL1
33
- H12 LITERAL1
34
-
Original file line number Diff line number Diff line change 1
1
name =RTCZero
2
- version =1.0 .0
2
+ version =1.3 .0
3
3
author =Arduino
4
4
maintainer =Arduino <
[email protected] >
5
5
sentence =Allows to use the RTC functionalities. For Arduino Zero only.
You can’t perform that action at this time.
0 commit comments