Arduino Forum

Products => MKR Boards => MKRFOX1200 => Topic started by: Lucas1394 on Mar 23, 2019, 05:24 pm

Title: More than one "interrupt" in RTCZero library
Post by: Lucas1394 on Mar 23, 2019, 05:24 pm
Hi All

Does anyone know if is It possible to use more than one interrupt in RTCZero library?


Can I use more than one interrupt for two different functions of code to run different scenarios depending upon which interrupt was registered ?

I need to send a SigFox message every hour. I am using the "alarm" of the RTCZero library to "wake up" the MKR1200 and to execute the function that reads all sensors and then send data. but meanwhile the arduino is "sleeping" sometimes I need to execute a function that increases a counter. (a pluviometer if it rains) and then sleep again until the other interruption occurs. (the one that sends data)

If anyone can help, here is part of the setup :
Code: [Select]
  rtc.setAlarmMinutes(0);
  rtc.enableAlarm(rtc.MATCH_MMSS);
  rtc.attachInterrupt(alarmMatch)//function that enables the sending of data;


And here is part of the loop :
Code: [Select]

rtc.standbyMode();


Thank you!