Arduino Workshop-Traffic Lights
We are now going to create a set of traffic lights based on the system that will change from green to red, via amber, and back again, after a set length of time using the four-state systemParts Required
Arduino UnoBreadboard
5mm LED
100Ω Resistor
Jumper Wires
You can read this book and it will help you to learn more About Arduino Beginning Arduino
Circuit Diagram
Traffic Lights
Connect your circuit as in Traffic Lights. This time, we have connected three LEDs with the anode of each one going to digital pins 8, 9 and 10, via a 150Ω current-limiting resistor (or whichever value you require) for each. Figure 2-6. The circuit for Project 3 We have taken a jumper wire from the ground of the Arduino to the ground rail at the top of the breadboard. A ground wire goes from the cathode leg of each LED to the common ground rail via a current-limiting resistor (this time, connected to the cathode). For this simple circuit, it doesn’t matter if the resistor is connected between the digital pin and the anode, or between the cathode and ground, as long as it is in series with the LED
Code
Previous tutorial
1. Arduino Workshop-LED Flashers
No comments