Traffic Intersection

Introduction: Traffic Intersection

traffic intersection

By: Marc Newman-Simoneau

what I coded was a traffic intersection using 12 LEDS, many jumper wires and resistors.

Supplies

Arduino Uno

jumper wires

12 or more led's

220 ohm resistors

breadboard

Step 1: Wiring

in this step I will share my code and wiring diagrams

code for reference

void setup()
{

pinMode(13, OUTPUT); // corrects the brightness of the leds so you cam actually see them

pinMode(12, OUTPUT);

pinMode(11, OUTPUT);// corrects the brightness of the leds so you cam actually see them

pinMode(10, OUTPUT);

pinMode(9, OUTPUT);

pinMode(8, OUTPUT);

pinMode(7, OUTPUT);// corrects the brightness of the leds so you cam actually see them

pinMode(6, OUTPUT);

pinMode(5, OUTPUT);

pinMode(4, OUTPUT);

pinMode(3, OUTPUT);// corrects the brightness of the leds so you cam actually see them

pinMode(2, OUTPUT);

pinMode(1, OUTPUT);

}

void loop() {

digitalWrite(10, HIGH);// makes the lights turn on

digitalWrite(4, HIGH);

digitalWrite(11, HIGH);// makes the lights turn on

digitalWrite(5, HIGH);

delay(4000); // delays the next code by 6 seconds

digitalWrite(10, LOW);

digitalWrite(4, LOW);// makes the lights turn off

digitalWrite(11, LOW);

digitalWrite(5, LOW);

delay(1500);// delays the next code by 1.5 seconds digitalWrite(6, HIGH);

digitalWrite(12, HIGH);// makes the lights turn on

digitalWrite(2, HIGH);

digitalWrite(8, HIGH);

delay(3000); // delays the next code by 6 seconds

digitalWrite(6, LOW);

digitalWrite(12,LOW);// makes the lights turn off

digitalWrite(2, LOW);

digitalWrite(8, LOW);

delay(2000);

digitalWrite(7, HIGH);

digitalWrite(3, HIGH);// makes the lights turn on

digitalWrite(9, HIGH);

digitalWrite(13, HIGH);

delay(4000); // delays the next code by 6 seconds

digitalWrite(7, LOW);

digitalWrite(3, LOW);// makes the lights turn off

digitalWrite(9, LOW);

digitalWrite(13, LOW);

delay(3000); // delays the next code by 6 seconds

digitalWrite(6, HIGH);

digitalWrite(12, HIGH);

digitalWrite(2, HIGH);// makes the lights turn on

digitalWrite(8, HIGH);

delay(2000); // delays the next code by 6 seconds

digitalWrite(6, LOW);

digitalWrite(12,LOW);

digitalWrite(2, LOW);// makes the lights turn off

digitalWrite(8, LOW);

}

Step 2: Diagrams

this is my wire diagram labeled as best i could because i could not write well with the editor and 3d paint

Step 3: Main Problems

my main problems were that the buttons wouldn't work for me, one of the days the port wouldn't read and the rest were mainly wiring problems on my part like putting them in the wrong pins. those were the technical problems .

the other difficulties were just on my part

Step 4: Items and Costs

Be the First to Share

    Recommendations

    • Puzzles Challenge

      Puzzles Challenge
    • Rice & Grains Challenge

      Rice & Grains Challenge
    • Lamps Challenge

      Lamps Challenge

    Comments