4 ms·
I agree that this is a bad analogy. I've programmed my own keyboards, mice and game controllers. If you want the fastest response time then you'd make debounci
by Findecanor 1y ago
I agree that this is a bad analogy.
I've programmed my own keyboards, mice and game controllers. If you want the fastest response time then you'd make debouncing be asymmetric: report press ("Make") on the first leading edge, and don't report release ("Break") until the signal has been stable for n ms after a trailing edge. That is the opposite of what's done in the blog article.
Having a delay on the leading edge is for electrically noisy environments, such as among electric motors and a long wire from the switch to the MCU, where you could potentially get spurious signals that are not from a key press.
Debouncing could also be done in hardware without delay, if you have a three-pole switch and an electronic latch.
A better analogy would perhaps be "Event Compression": coalescing multiple consecutive events into one, used when producer and consumer are asynchronous.
Better but not perfect.
- Sharlin 1y agoDebouncing is established terminology in UI and other event-handling stuff at this point, and has been for a decade. It's a bit too late to complain. Language evolves and not all new uses of words are good analogies.
- em3rgent0rdr 1y agoYeah. It is not too uncommon for terms to refer to how things were done in the past or in another context. For example, we still "dial" a number on our phone even though rotary phones are no longer used...for other examples see https://en.wikipedia.org/wiki/Misnomer#Older_name_retained https://en.wikipedia.org/wiki/Misnomer#Older_name_retained
- kazinator 1y agoThat's the same context (making a call to a phone number) with a different implementation.
- kazinator 1y ago> for a decade Whoa!
- pas 1y agofor anyone else interested in the analog implementation, I found this :) https://www.digikey.ee/en/articles/how-to-implement-hardware-debounce-for-switches-and-relays https://www.digikey.ee/en/articles/how-to-implement-hardware...