Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I know what debouncing is, but I don't really grok it. Is there a Khan Academy-style explaination somewhere?


If you hook up an oscilloscope to a physical button, you will see that there's not a nice clean on/off when you press it [1]. The signal bounces on and off for quite some time after. This is a problem in a lot of situations. If, for example, a momentary push button is used as a power button on a device, it might be connected to an interrupt on a microcontroller. Without debouncing the device will rapidly switch on and off dozens of times over a millisecond. While there are easy ways of debouncing in hardware, most don't bother, as it's very simple to do in software. The simplest is just to ignore or disable the interrupt for a short period (a few milliseconds, perhaps).

Here's an Arduino sketch showing a simple way of doing it. https://www.arduino.cc/en/Tutorial/Debounce

[1] http://www.labbookpages.co.uk/electronics/files/debounce/bou...


Many thanks




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: