Damn, didn't have that sketch in my folder, maybe i had an old release. Just found it in the latest release. Gonna try it soon and test if does the job that i need to be done. Thank you for your advice
Posts made by funksoulbrother
Custom Interrupt routine for door sensor
Dear guys, i'm approaching a problem similar to the one presented in this topic: http://forum.mysensors.org/topic/271/interrupt-driven-contact-sensor/2
I have a node with a DHT11 and a magnetic reed switch to control a door movement. My node sleeps for a determined time interval with the gw.sleep method. And iìd like to wake it up when the timer runs out or when an interrupt is received ( easy to do) . My problem is that i want to perform a specific action when the interrupt is received. Something like : Node Sleeping ---> pin Interrupt ---> Custom action performed ---> other routine in the loop ----> sleep again.
In particular when the door is opened or closed, i'd like to start a routine that reads the door interrupt pin and reports its status.
Using instead the defined gw.sleep(IntPin,TypeOfInt,SleepTime) command
with CHANGE i could catch the door movement but i cannot know the status of the door. Using RISING or FALLING i can get only one of the 2 moves ( open or close) , and with LOW, when door is closed, my node stucks.
My ideal routine should be something like : interrupt received -->wake up node ---> read interrupt pin ---> send to gateway the value that has been read and blink a led--> put the node back to sleep.
Can someone help me? i'm attaching the sketch i wrote that's not working well ( freezes). In this sketch the led blinking is missing ( but that's secondary)