Signals and controls
Momentary pushbutton
A physical input for toggles, counters, and acknowledgements.
What it does
Pressing the button joins its contacts. Mechanical contacts bounce briefly, so software waits for a stable change before counting a press.
Connections and compatibility
Use INPUT_PULLUP and connect the input to ground through the switch. Released reads HIGH; pressed reads LOW. On four-leg tactile switches, two legs may already be permanently joined.
Choosing one
A starter-kit tactile button or any normally open momentary switch works. Confirm its connected pairs with a continuity meter.
Common mistakes
A floating input produces unpredictable readings. Holding a button down should not count as repeated presses unless that is intentional.
Use it in a tutorial
- Buttons and switches — Wire a button with an internal pull-up, debounce it, and toggle an indicator once per press.
- Servo motors — Move a lightweight pointer with two buttons while powering a micro servo independently of the controller.