EasyButton icon indicating copy to clipboard operation
EasyButton copied to clipboard

Callback for button release?

Open mrdc opened this issue 5 years ago • 6 comments

Hello,

Would be nice to add a callback for button release.

Thanks!

mrdc avatar Nov 12 '19 19:11 mrdc

There is a callback for button release, is onPressed event, maybe what you mean is that it would be nice to have a onReleasedFor event. Thanks for your feedback

elC0mpa avatar Nov 12 '19 19:11 elC0mpa

Yes, just for the release event. I need to catch it once when there is HIGH on pin, do some work and catch it once again when there is LOW on pin. What I have now is that my Serial is flooded if I use wasPressed and isReleased. Can't catch HIGH once and LOW once.

mrdc avatar Nov 12 '19 19:11 mrdc

Greetings @elC0mpa The callback is not called for me when the button is released, only when it is pressed. Perhaps I am missing something?

source-creator avatar Feb 21 '20 18:02 source-creator

Hi @source-creator Please provide your code to see if there is any issue and we'll try to reproduce it in our side.

evert-arias avatar Mar 18 '20 17:03 evert-arias

Did anyone get a OnRelease Callback working?

gogreenpower avatar Mar 22 '21 06:03 gogreenpower

I setup a check for btn.isReleased() after btn.read() once pressedFor(X)was triggered.

btn.read();
if (waspressedforsometime && btn.isReleased())
{
  onRelease();
}

eppfel avatar May 03 '21 15:05 eppfel