Electronic Component
There are four pins on the button
1 2 , 3 4 are turned on after pressing
1 3 , 2 4 Initial conduction
Usually the key switch is a mechanical elastic switch, the switch will not be turned on immediately and stably when it is closed, and there will be a series of vibrations
The length of the jitter time is determined by the mechanical characteristics, generally 5ms to 10ms.
Classification of Debounce
hardware debounce
Software debounce
Generally, the pressed state means that the button has been pressed, and the delay is 10ms, which is the software debounce processing
Generally use software debounce