#004 Pushbutton LED Switch
Momentary push button switch is used to toggle the LED on and off.
Notes
A simple circuit showing how to wire a pushbutton with a pull-down resistor for a digital input that is normally low but pulls high when pressed.
Pressing the button will toggle the LED between on and off. See LEAP#692 for how to achieve a similar result with a simple 555 timer chip.
The Sketch
The PushbuttonLED.ino sketch:
- reads the push-button digital input
- toggles the LED output state between ON and OFF when a button press is detected
- logs to serial output so one can inspect the behaviour