Einföld umferðarljós sett saman úr Super starter kit pakkanum
Apart from the basic Arduino, you'll need:
1 x 10k-ohm resistor
1 x pushbutton switch
6 x 220-ohm resistors
A breadboard
Connecting wires
Red, yellow and green LEDs
Almost any Arduino will work for this project, providing it has enough pins. Make sure you read our Arduino buying guide if you are not sure what model you need. You may already have these parts in your Arduino starter kit.
Let's start small. A basic, single traffic light is a good place to start. Here's the circuit:
Connect the anode (long leg) of each LED to digital pins eight, nine, and ten (via a 220-ohm resistor). Connect the cathodes (short leg) to the Arduino's ground.
Start by defining variables so that you can address the lights by name rather than a number. Start a new Arduino project, and begin with these lines: