This project demonstrates a simple digital input-output control using an Arduino. It involves a pushbutton that, when pressed, turns on a built-in LED on the Arduino board. This is a fundamental ...
Here, when the button pressed, the 5v will be sent to pin 2. There's another way to set up a button, which would use the Arduino's internal pull up resistor. Here is ...