07-05-2020, 02:37 PM
(This post was last modified: 07-05-2020, 03:19 PM by TheOldPresbyope.
Edit Reason: added note.
)
@waffle
What I mean by appropriate change to the call-back function is that if you change from detecting a rising edge to detecting a falling edge, then the call-back function has to be changed to check that the signal is still '0' after a suitable timeout instead of still '1'.
There's some interesting information in the "Debounce and Delay" section of this reference. The author suggests there's a bug in RPi.GPIO. On the face of it, his fix is the same as what is done in moOde's GPIO handler, but I was struck by his comment about the appropriate length of the timeout.
Without a testbed here, I can't contribute anything beyond this.
Good luck.
Regards,
Kent
Note added: There are plenty of resources on line. This is just the last article in a series of 9 called collectively "Ultimate Guide to Switch Debounce." Good illustrations and good discussion.
What I mean by appropriate change to the call-back function is that if you change from detecting a rising edge to detecting a falling edge, then the call-back function has to be changed to check that the signal is still '0' after a suitable timeout instead of still '1'.
There's some interesting information in the "Debounce and Delay" section of this reference. The author suggests there's a bug in RPi.GPIO. On the face of it, his fix is the same as what is done in moOde's GPIO handler, but I was struck by his comment about the appropriate length of the timeout.
Without a testbed here, I can't contribute anything beyond this.
Good luck.
Regards,
Kent
Note added: There are plenty of resources on line. This is just the last article in a series of 9 called collectively "Ultimate Guide to Switch Debounce." Good illustrations and good discussion.