Clear input event queues?? #1065
Unanswered
kkelly3137
asked this question in
Q&A
Replies: 1 comment 1 reply
-
It's a bit of a hacky solution (because it uses global variables), but perhaps an approach like this pseudo-code might work?
This way, the |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Does gpiozero have any mechanisms to clear the interrupt queue(s) of a GPIO input? Not for switch denounce purposes but if the user "just keeps pressing the button" it can cause undesired results of the event triggering multiple times.
My application is doorbell that is connected to the Pi the calls a phone number or plays a tone file based on a schedule. Using the mybutton.when_held timer (BTW -- thanks sooo much!!! It SOLVED a bunch of RF noise random trigger issues) but it doesn't stop the user from pressing the button multiple times within the when_held timer .
The events that can be triggered can take 6 - 15 seconds to resolve (play a tone or dial a phone number, wait for answer) so clearing the input queue after the event would be desirable.
Again great code! Thx
-Kevin-
Beta Was this translation helpful? Give feedback.
All reactions