Open i0n- opened 2 years ago
Hi @i0n-, I haven't had time to take a look at this, but I will do it soon.
I found the same problem
The solution is:
Add start value of
_held_callback_called = false;
void EasyButtonBase::onPressedFor(uint32_t duration, EasyButtonBase::callback_t callback)
{
_held_threshold = duration;
_pressed_for_callback = callback;
_held_callback_called = false;
}
Code work fine after the first press of the button. When I press by the first time is not detected (failed or missing)... second one and beyond works fine.
With this little change work fine since the beginning.
My current test environment is with the flash button on NodeMCU (ESP8266) board