- 1 Green LED
- 1 Red LED
- 1 Orange LED (I did not have yellow)
- 3 resistors (220 Ohm)
- 1 resistor (1k Ohm)
- 1 Push-to-make switch
Time to complete: 15 minutes
Since I did not have a plethora of colors available in my LED collection, I had use an orange LED instead of a yellow one of similar brightness to the red and green LEDs. I could have tried to increase the brightness of the orange LED by pairing it with a smaller resistor, but honestly, until the project become more difficult, proof of completion is all I'm looking for.
The code for this program is very simple. there is one loop that goes through the light states with a 1000 ms delay after each state. After the delay, the program checks to make sure that the button is pressed before going into the next state. This project is a nice introduction to adding switches to a simple circuit. Below is a video of the completed project.