Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <RTCZero.h>
- RTCZero rtc;
- const byte seconds = 0;
- const byte minutes = 00;
- const byte hours = 00;
- int value = 0;
- void setup()
- {
- Serial.begin(9600);
- rtc.begin(); // initialize RTC
- rtc.setMinutes(minutes);
- rtc.setAlarmSeconds(120);
- rtc.enableAlarm(rtc.MATCH_SS);
- rtc.attachInterrupt(alarmMatch);
- Serial.println("start ");
- }
- void loop()
- {
- if (value == 1)
- {
- Serial.println("2 minuten gedaan ");
- value = 0;
- }
- }
- void alarmMatch()
- {
- value = 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement