Replies: 1 comment
-
You are re-initialising the timer on each edge from the button, which should prevent the timer callback from running until 20ms after the last edge. This looks OK. As a general point using interrupts to debounce switches is not ideal for reasons discussed here. You might like to look at |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
is this a proper way of debouncing a key ? This is for a pico 2, if it matters.
In this code, I am assuming, that any change in button triggers a callback, overwriting previous timer interrupts, so that only the last state change of button will be then dealt with in function "tcb". Are those valid assumptions ?
thanks, Rolf
Beta Was this translation helpful? Give feedback.
All reactions