sleep() in MySensors 2.2.0
-
Hello all,
I have read about a long discussion about sleep() in MySensors with @AWI and @Yveaux discussing that for PIR sensors sleep must be used with "LOW" interrupt according to atmega328p spec. However, I did try it and it just does not work. If I change
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);to anything like
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), LOW, SLEEP_TIME);my PIR stops working.
I cannot use smartSleep() as I have Domoticz.What's the final verdict? How sleep function has to be used please?
-
Hello all,
I have read about a long discussion about sleep() in MySensors with @AWI and @Yveaux discussing that for PIR sensors sleep must be used with "LOW" interrupt according to atmega328p spec. However, I did try it and it just does not work. If I change
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME);to anything like
sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), LOW, SLEEP_TIME);my PIR stops working.
I cannot use smartSleep() as I have Domoticz.What's the final verdict? How sleep function has to be used please?
@alexsh1 it is a bug in the atmega datasheet that only certain levels can be used. Change should also work, although it might give two wakes for each trigger.
Make sure to use mySensors 2.2.x as some issues with waking from sleep by interrupts have been fixed. -
@alexsh1 it is a bug in the atmega datasheet that only certain levels can be used. Change should also work, although it might give two wakes for each trigger.
Make sure to use mySensors 2.2.x as some issues with waking from sleep by interrupts have been fixed.