Arduino Uno and Traffic Lights

Wiring diagram

Here is the code…

void setup() 
{
  for (int i = 9; i < 12; i++)
  {
    pinMode(i, OUTPUT);
  }
}
void loop()
{
  digitalWrite(11, HIGH);
  delay(1000);
  digitalWrite(10, HIGH);
  delay(1000);
  digitalWrite(11, LOW);
  digitalWrite(10, LOW);
  digitalWrite(9, HIGH);
  delay(1000); 
  digitalWrite(9, LOW);
  digitalWrite(10, HIGH);
  delay(1000);
  digitalWrite(10, LOW);
}

Looks something like this

Brief explanation

You will be connecting the red, yellow and green pins to pins 11, 10, 9 respectively and the GND to the ground on the Arduino using male to male jumper leads. the breadboard and Arduino Uno are on an acrylic base plate. this keeps things nice and tidy and together, useful if you start moving it around.