And something else, which we'll start with before trying to regulate our traffic.
We'll use LEDs (Light Emitting Diode): 1 red, 1 yellow and... ?!?!
yes, 1 green.
In the first part every LED will be gradually turned from off to on and viceversa.
After that, the traffic lights: just one LED on.
We need following stuff:
- Arduino Duemilanove Board;
- 3 LEDs;
- 3 of 100 resistors;
- a nominally 4,7 trimmer resistor or potentiometer, to change the amount of voltage (every kind of volume regulator is a potentiometer);
- some wires.
Why do we put resistors in series to LEDs and before them?
To be sure, read LEDs datasheets and check the maximum voltage-current they can support (and set a lesser one to work).
Now see the picture above: this configuration is quite perfect for all goals.