I edited from Arduino Turn on Led Using Button by mehmetsukru
Originally, you hold the button (there's only one) the light will be on, and it will not light when released. I change to two buttons. One is for turning on the light, and another is for turning off, like a night light.
- Light bulb x1
- Male to male breadboard jumper wires
- Resistors x1
- Arduino Leonardo
- Buttons x2
- A bag
Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.
Step 1: To Get Started
This is very simple!
- Connect one button to pin 2 and positive electrode (+)
- Connect another button to pin 3 and +
- Connect 5v to the +
- Connect GND to the negative electrode (-)
- Connect one foot of the light to the negative electrode (-) , insert resistor's one foot on the same row (straight row).
- Connect to pin 9 with the other foot of the resistor (straight row)
- Use a bag to cover the wires