EasyButton
EasyButton copied to clipboard
Callback for button release?
Hello,
Would be nice to add a callback for button release.
Thanks!
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
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.
Greetings @elC0mpa The callback is not called for me when the button is released, only when it is pressed. Perhaps I am missing something?
Hi @source-creator Please provide your code to see if there is any issue and we'll try to reproduce it in our side.
Did anyone get a OnRelease Callback working?
I setup a check for btn.isReleased()
after btn.read()
once pressedFor(X)
was triggered.
btn.read();
if (waspressedforsometime && btn.isReleased())
{
onRelease();
}