Traffic Intersection

by newmanmarc7 in Circuits > Arduino

347 Views, 0 Favorites, 0 Comments

Traffic Intersection

download.png
frosted-leds-red-green-blue-yellow-white-800x800.jpg
869c9f69-930f-4356-ab11-b4248f2062da._CR0,0,970,600_PT0_SX970__.jpg
Capture.PNG

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

Wiring

Capture.PNG
Capture.PNG4.PNG
Capture.PNG5.PNG
Capture.PNG6.PNG
Capture.PNG7.PNG

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);

}

Diagrams

Capture.PNG10.PNG
Capture.PNG

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

Main Problems

download (2).png

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

Items and Costs

download (3).png