I’ve never seen a collection like this, it’s quite amazing.<p>It’s worth pointing out that due to the x1 probe there’s an input capacitance of about 50-60 pF, which would result in a 200 kHz low-pass for opening and dampen high speed oscillations in general. You can see this in the graphs with the rising transitions being slightly rounded. MCUs have much lower capacitance in their pins, so reality would tend to look even messier than this, especially zoomed in.
The big question is whether there are spurious transitions from noise or EMI. Generally, the pull-up or pull-down is strong enough so that, except while switching, the raw signal will stay reliably high or reliably low. If this is true, then you can act as soon as you see the first change in the raw signal. Then you have a time constant before you will consider a change in the opposite direction to be valid. That way, no matter how quickly the user taps a button, you will a) act as soon as possible, and b) not miss a tap.
I always refer to this multipart series on debouncing from one of the greats of embedded, (the now retired) Jack Ganssle<p><a href="https://www.ganssle.com/debouncing.htm" rel="nofollow">https://www.ganssle.com/debouncing.htm</a>
Mechanical bouncing should be pretty predictable - ie. A particular bit of metal briefly resonating at a frequency based on the speed of sound in the material.<p>However, these traces look more chaotic.<p>Anyone know why?