Closed thkfighter closed 5 years ago
Hello @thkfighter, are you sure that this es exactly what is happening? I ask you because @evert-arias and i tested this feature before including it to the library and everything was fine. In case this is what is really happening, I could recommend you to increase the debounce time of the button and try it again. Please give us your feedback.
Hello @thkfighter, are you sure that this es exactly what is happening? I ask you because @evert-arias and i tested this feature before including it to the library and everything was fine. In case this is what is really happening, I could recommend you to increase the debounce time of the button and try it again. Please give us your feedback.
I'm afraid so.
According to your response, I changed the debounce time from default 35ms to 200ms. It did not work either.
EasyButton button3(buttonPins[2], 200, true, true);
The board is ESP-12S from Ai-Thinker, with three buttons connected on GPIO 4, 5 and 16 respectively.
Hi @thkfighter I'm going to run some tests on what you have pointed out and get back to you later. Regards
@thkfighter there is a mistake in your code. If you want to use the onPressedFor functionality through external interrupts, you should call the update method in the loop function as shown here: https://github.com/evert-arias/EasyButton/blob/master/examples/InterruptsOnPressedFor/InterruptsOnPressedFor.ino Please fix this in your code and let us know if everything is working as expected
@thkfighter there is a mistake in your code. If you want to use the onPressedFor functionality through external interrupts, you should call the update method in the loop function as shown here: https://github.com/evert-arias/EasyButton/blob/master/examples/InterruptsOnPressedFor/InterruptsOnPressedFor.ino Please fix this in your code and let us know if everything is working as expected
@elC0mpa @evert-arias Thanks a lot. It works.
//...
void loop()
{
//Main code
button3.update();
}
I pressed button3 for more than 5 seconds and then released it, onPressed() responsed instead of onPressedFor().