You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
produces a nice ~500 Hz square wave on pin D0, because the IDLE state is ended by the SysTick interrupt every ms.
This is fine and useful, but should be properly documented.
Adding any value as argument to LowPower.idle(): (I use random() here to emphasize any)
LowPower.idle((int)random(1000));
lowers the frequency to ~10.6 Hz.
Setting the RTC alarm takes ~46 ms, and then the IDLE state is ended on the next SysTick interrupt.
Most of the time needed to set the RTC alarm comes from synchronisation calls in RTCZero.cpp like
while (RTCisSyncing())
;
I guess looping around the wfi instruction waiting for the right time to pass would be a better solution than using the RTC...