We are making a sensor hub using autonomo , and need to read data every 15minutes or so and sleep rest of the time. Data gathering and sending part is working fine, but we are encountering difficulty when using sleep.
To wake-up, after every ‘X’ time interval we are using
RTCZero library and toggling the onboard LED as a check. The issue is that
if condition is executed once, after that it’s never executed.
The code we used is:
uint8_t seconds = 0;
uint8_t minutes = 00;
uint8_t hours = 00;
volatile bool rtc_flag = false;
rtc.setTime(hours, minutes, seconds);
rtc_flag = false;
rtc.standbyMode(); // Sleep until next alarm match
rtc_flag = true;
Is there any other way to achieve sleep of ‘X’ minutes continuously.