- Posts: 30
- Thank you received: 0
PaulRB wrote: Hi, hopefully a quick question:
My MySensors sketches contain calls such asfor 1 minute low-power sleeps. This command also allows for waking on a hardware interrupt, e.g. on pin 3 on atmega328.gw.sleep(60000);
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.