Guest User

Untitled

a guest
Mar 18th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. enter code here
  2.  
  3. void main(){
  4. ...
  5. //set alarm at 16:0:0 and trigger Event_1 at interrupt time
  6. rtc.enableAlarm(16,0,0);
  7. rtc.attachInterrupt(Event_1_isr);
  8. ...
  9. }
  10.  
  11. void Event_1_isr()
  12. {
  13. ...some code...
  14. //Set next alarm and interrupt Event_2
  15. rtc.setAlarmTime(16, 0, 15);
  16. rtc.enableAlarm(rtc.MATCH_HHMMSS);
  17. rtc.detachInterrupt();
  18. rtc.attachInterrupt(Event_2_isr);
  19. }
  20.  
  21. void Event_2_isr(){
  22. ...some code...
  23. //I guess you get the point
  24. rtc.setAlarmTime(16, 0, 30);
  25. rtc.enableAlarm(rtc.MATCH_HHMMSS);
  26. rtc.detachInterrupt();
  27. rtc.attachInterrupt(Event_3_isr);
  28. }
Add Comment
Please, Sign In to add comment