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.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login