SIK 5 - Push Buttons
We'll build SIK Circuit #5 - Push Buttons.
- First, build SIK Circuit #1 - Blinking an LED.
- Then, insert one of the buttons into the circuit so that the LED only turns on when the button is pressed. You shouldn't need to change your code.
- Now, move the button so that it's connected between pin 2 and +5V. You'll need to put a 10kΩ resistor from ground to one leg of the button, then connect the other leg of the button to +5V. Put the wire from pin 2 to the same button leg that is connected to ground.
- Modify your program to only turn on the LED when the button in pin 2 is pressed down.
Learning Targets
- I can explain how to use a button in a circuit to turn a light on.
- I can explain how to use a button in a program to turn a light on.