for 1 minute low-power sleeps. This command also allows for waking on a hardware interrupt, e.g. on pin 3 on atmega328.
Will millis() continue to update normally during low power sleeps? I want to use it for measuring the time between interrupt events. If not, how can I measure how long the sleep was before the interrupt occurred?
I ask because I want to connect up an anemometer. The anemometer contains a reed switch, activated by a magnet, which is closed twice per revolution. By timimng the period between switch closed or open events, or by counting the number of such events over a fixed period, I will be able to calculate wind speed (I have calibration data to use in that calculation). Either way, I need to measure time intervals accurately, while keeping the atmega in low power sleep as much as possible.
for 1 minute low-power sleeps. This command also allows for waking on a hardware interrupt, e.g. on pin 3 on atmega328.
Will millis() continue to update normally during low power sleeps? I want to use it for measuring the time between interrupt events. If not, how can I measure how long the sleep was before the interrupt occurred?
I ask because I want to connect up an anemometer. The anemometer contains a reed switch, activated by a magnet, which is closed twice per revolution. By timimng the period between switch closed or open events, or by counting the number of such events over a fixed period, I will be able to calculate wind speed (I have calibration data to use in that calculation). Either way, I need to measure time intervals accurately, while keeping the atmega in low power sleep as much as possible.
Thanks,
Paul
If I remember correctly mils() doesn't work correctly during gw.sleep. Some ideas to solve this:
-change MySensors library to use different sleep library. Some sleep libraries allow mils()
-use external RTC to measure time
-send pulses to EasyIoT server and let the server do the calculation