I feel like I've tried everything but nothing will work.
It seems that the OneButton library just wont work with the NodeMCU board, Please help, I don't know what to do or what to change in the library.
I did try downloading the file and I am also encountering the same issue (none of the sketches seem to compile). It seems to me like maybe to library is too old (considering nothing has been updated for 2-3 years). However, I am not an expert at Arduino, so there is a chance that I am wrong. Is it possible to post the error you are getting?
You have not defined for anything to happen. You need to define the functions that you want called when the switch changes states, in a variety of ways.
PaulS:
You have not defined for anything to happen. You need to define the functions that you want called when the switch changes states, in a variety of ways.
But I'm pretty sure that I have.
This method (button.tick() ) checks the button and if it's been clicked, the library will run the code declared in the attachClick function.
This method (button.tick() ) checks the button and if it's been clicked, the library will run the code declared in the attachClick function.
I missed that. Sorry.
Put some Serial.print() statement in the library, and see what it is doing.
One thing that the library is doing wrong is diddling with the hardware in the constructor. When the constructor runs, before init() is called, the hardware is not ready to be diddled with.
Put some Serial.print() statement in the library, and see what it is doing.
One thing that the library is doing wrong is diddling with the hardware in the constructor. When the constructor runs, before init() is called, the hardware is not ready to be diddled with.
That may be a problem on your hardware.
No worries (:
When is init() called? In the backround at the beginning of setup()?