evert-arias / EasyButton

Arduino library for debouncing momentary contact switches, detect press, release, long press and sequences with event definitions and callbacks.
https://easybtn.earias.me
MIT License
447 stars 62 forks source link

vButton.onPressedFor issue #59

Open mdleisure opened 2 years ago

mdleisure commented 2 years ago

Hi I have used the example in the library examples to test the Vbutton code.

I am using esp8266 (12e) and a MCP23017 non interupt

I have tried both with a library for the 23017 and also direct register coding and I get the same result when trying to use on pressed for.

As soon as I add the vButton.onPressedFor(2000, buttonPressedForTwoSeconds); into the code then that it pretty much all you will get.

There is not really any single press anymore. As soon as you do a single press there is a slight delay and then the callback for onpressed for runs and not the single press.

I have no problem running on the Internal GPIO pins on the esp but using a 23017 and the Vbutton for io ports gives me this issue.

I have displayed the bool to see if it was holding an incorrect state but that it all fine.

It just seems to be as soon as you add in the pressed for it only uses that.

Has anyone else done a physical test that may be able to help.

Thanks

sledzik1984 commented 1 month ago

I also have this problem