bxparks / AceButton

An adjustable, compact, event-driven button library for Arduino that debounces and dispatches events to a user-defined event handler.
MIT License
393 stars 37 forks source link

No longer responding to single click #76

Closed ullix closed 3 years ago

ullix commented 3 years ago

I have been using AceButton on an ESP32's 'Boot' button (GPIO 0) and it worked really well with Click, Doubleclick, and Longpress. But suddenly I get no longer a 'Clicked' response, but I still get Double and Long.

I was using version 1.6, and after detecting the problem, I upgraded to 1.8.3, but no change to my problem.

When pressing a button I see a kEventPressed. Pressing again after some 10+ seconds, I see another kEventPressed followed by a kEventDoubleClicked. Doing a doubleclick as fast as I can also gives a correct kEventDoubleClicked.

Longpress still coming correctly after 2 sec (programmed setLongPressDelay(2000);).

Setting 'setClickDelay()' down to 100 or up to 1000 does not make a difference.

How do I get my click back?

bxparks commented 3 years ago

If you are getting a kEventDoubleClicked, then it must be detecting a kEventClicked, because the DoubleClicked depends on the Clicked. So it sounds like you changed something in the configuration of ButtonConfig or your event handler.

Try stripping down your program to get rid of everything but the AceButton related code, insert some Serial.println() statements in the handleButtonEvent() and figure out what's going on.