Open ravelab opened 5 years ago
I can confirm this. Basically sleeping for some seconds only seems to always add 1s extra:
rtc.setSeconds(0); rtc.setAlarmSeconds(0); rtc.enableAlarm(rtc.MATCH_SS); rtc.standbyMode();
-> Above results in a sleep for 1s.
rtc.setSeconds(0); rtc.setAlarmSeconds(1); rtc.enableAlarm(rtc.MATCH_SS); rtc.standbyMode();
-> Above results in a sleep for 2 seconds. And so on. I'm using version RTCZero 1.6.0 on an Adafruit Feather M0. No SleepyDog in use.
Interestingly the ArduinoLowPower (which uses the RTC too) lib does the same on my Feather M0
LowPower.sleep(0); -> sleeps for 1s LowPower.sleep(1000); -> sleeps for 2s
I tested with the TimedWakeup example: https://www.arduino.cc/en/Tutorial/LowPowerTimedWakeup
Might be a special behavior of the Adafruit M0 based Feathers?
I set it up like this:
setup() { rtc.begin(); rtc.setAlarmSeconds(59); rtc.enableAlarm(rtc.MATCH_SS); Watchdog.enable() }
loop() { Watchdog.reset(); LED OFF rtc.setSeconds(58); rtc.standbyMode(); LED ON }
I'm expecting it to sleep 1 second, but it actually sleeps 2 seconds. I'm also using Adafruit_SleepyDog for watchdog. Don't know if that matters.
Thanks