ArneDunio:
The button is wired directly to the PIN 2 no resistor yet
Implement a pullup or pulldown resistor, wire the switch accordingly and change the program logic to match. INPUT_PULLUP in the pinMode() is the easiest way.
ArneDunio:
The button is wired directly to the PIN 2 no resistor yet
Implement a pullup or pulldown resistor, wire the switch accordingly and change the program logic to match. INPUT_PULLUP in the pinMode() is the easiest way.