my wireless weather station is working. It uses the RF24 library to drive nRF24L01 radio modules. Now I want to add a tipping bucket rain gauge. I am using the pingpair_sleepy example as the basis of this project. The sending Arduino goes to sleep and the watchdog timer wakes it up periodically to send in some values over the radio link.
My research found that only way to wake a sleeping arduino is to use a low interrupt. So the interupt wakes the arduino and increments a drip variable in a isr routine. Now i want the Arduino to go back back to sleep. If the interrupt wakes the Arduino, is the sleep mode still active or do i have to call it again.
The sleep code function in the example calls sleep, and then continues executions when the watchdog wakes it in the same function. Will the interrupt act like the wake up of the watchdog and sketch execution restart right after the sleep call?
if i detach the interrupt so it won't interfere with the radio transmission, and then attach it again, and the bucket is in the low condition will the interrupt trigger? Ideally this is what i want - the actual time the signal is low is somewhat long compared to the sketch execution so I am hoping that the time required to send will not exceed the actual time the reed relay is held low and attaching the interrupt again will capture the ongoing event.
Interrupts are a big concept to wrap my mind around. So i turn to the gurus for sage advice.