mathertel / OneButton

An Arduino library for using a single button for multiple purpose input.
http://www.mathertel.de/Arduino/OneButtonLibrary.aspx
Other
954 stars 230 forks source link

doubleclicking results in singleclick #94

Closed linxcow closed 2 years ago

linxcow commented 3 years ago

My finger doubleclick speed is probably too fast for the default values , i have to slow my doubleclicking to make it work. Do others have the same problem , might be interesting to change the default values in the library , to broaden the timing range.

linxcow commented 3 years ago

Changing the debounce time back to 50ms from 80 in the example made it a lot better

mathertel commented 3 years ago

The debounce time is required to compensate high frequent HIGH-LOW-HIGH-LOW-... sequences when a momentary button gets opened or closed. The is caused by "bad" hardware and the duration depends on physical measurements like elasticity of the contact material and bad connections caused by dirt. There is no "Best" timing but you can adjust - as you did - to your specific hardware. Adding a small capacitor in parallel to the button also helps.

mathertel commented 2 years ago

I just saw a dev board with the following components: