JC_Button icon indicating copy to clipboard operation
JC_Button copied to clipboard

Not immune to noise :(

Open guillaume-dorczynski opened this issue 1 year ago • 2 comments

Hello Jack

I've been using and recommending this library for years, but recently had a problem with buttons in a project using this library, and after investigating I found that the problem lies in your debounce code.

The problem is that button press/release changes are detected immediately, your code only prevents multiple changes during the debounce time. Therefore, it's not immune to noise!

To be clear, I always thought the button press/release was detected after the debounce time, not before, to wait for the button state to be stabilized.

Here is a Wokwi demo with the debounce time set to one second : https://wokwi.com/projects/353568497230783489

guillaume-dorczynski avatar Jan 11 '23 14:01 guillaume-dorczynski