This project counts and displays button presses on an Arduino board via the Serial Monitor.
The circuit monitors a button connected to the Arduino, incrementing a counter each time the button is pressed. When a press is detected, the current count is sent through the serial connection to display on your computer. The program uses a simple state tracking mechanism to avoid counting multiple presses when the button is held down.
Parts List
- Arduino board
- Momentary push button
- 10kΩ resistor (pull-down)
- Breadboard
- Jumper wires
Assembly Instructions
- Connect one terminal of the push button to digital pin 2 on the Arduino
- Connect the other terminal of the push button to the 5V pin
- Connect a 10kΩ resistor between digital pin 2 and GND (this acts as a pull-down resistor)
- Connect the Arduino to your computer and upload the code
- Open the Serial Monitor and ensure it’s set to 115200 baud rate
- Press the button to see the count increment on the Serial Monitor