Closed Fusionlight13 closed 3 months ago
It is probably your code. The else if
statements inloop()
do not make sense in this context and should be replace with separate if
statements. Otherwise the button updates are not consistently executed every loop.
If you want an else if structure
, run all updates first in a separate block and then check if they were pressed in a separate else if
block.
For further issues on general coding please use https://forum.arduino.cc/latest
Thanks for the help!
I made a function with a switch statement to call each button by value to update and return the .pressed method. Multiple presses are returning true which is really confusing me. I use the INPUT_PULLUP mode and attach the wires to ground and the digital pins. I can't figure out if it's an issue with my wiring or the library.