If anyone needs a verbal explanation of bouncing, debouncing, or how a basic debounce algorithm works, let me know. I love debouncing buttons. I think it's a lot of fun, and requires an understanding of interesting electrical and mechanical properties.
Note that if anyone says "but I have a low-pass filter via resistor and capacitor to debounce the button in hardware, so we don't need debouncing in software", they are wrong. Hardware debouncing can significantly help, but is not foolproof. Software debouncing is foolproof when done right. Add the logic to also debounce in software anyway. It's not that hard.
If anyone needs a verbal explanation of bouncing, debouncing, or how a basic debounce algorithm works, let me know. I love debouncing buttons. I think it's a lot of fun, and requires an understanding of interesting electrical and mechanical properties.
Note that if anyone says "but I have a low-pass filter via resistor and capacitor to debounce the button in hardware, so we don't need debouncing in software", they are wrong. Hardware debouncing can significantly help, but is not foolproof. Software debouncing is foolproof when done right. Add the logic to also debounce in software anyway. It's not that hard.
Debounce logic I wrote in 2016, before I was as good at coding--so please don't judge too harshly--but the debounce logic is sound: https://github.com/ElectricRCAircraftGuy/eRCaGuy_EventReader/blob/master/eRCaGuy_EventReader.cpp#L101-L160
Adafruit debouncing background, explanation, and a code library called
adafruit_debouncer
: https://learn.adafruit.com/debouncer-library-python-circuitpython-buttons-sensors?view=allI labelled this image which was from the article above: