/*218540787 KF KHANYA*/
/*Use pin 4-11 to connect a two-way traffic
Output pin setp
Pin 4 = Red
Pin 5 = Amber
Pin 6 = Green
Pin 7 = Arrow
Pin 8 = Red
Pin 9 = Amber
Pim 19 = Green
Pin 11 = Arrow
*/
int delay1 = 3000;
int delay2 = 1000;
void setup() {
// Initializing port B nd D as output port
DDRD = B11111100; // setting pins 2 to 7 as output
DDRB = B11111111; // setting pins 8 to as output
}
void loop() {
digitalWrite(4, HIGH); //turning the red LED on
digitalWrite(10, HIGH); //turning the green LED on
delay(delay1); //delay for 3 seconds
digitalWrite(10, LOW); //turn the green LED on
digitalWrite(9, HIGH); // keep the red LED on
delay(delay2); //delay for 1 second
digitalWrite(9, LOW); // turning the amber LED on
digitalWrite(4, LOW);
digitalWrite(8, HIGH); // turning amber on
digitalWrite(6, HIGH); //
delay(delay1);
digitalWrite(6, LOW); //
digitalWrite(5, HIGH); //keep red LED on
delay(delay2); //delay for 1 second
digitalWrite(5, LOW); //turn the amber LED ON
digitalWrite(8, LOW); //turning the green LED off
digitalWrite(4, HIGH);
digitalWrite(10, HIGH);
delay(delay1); //delay for 3 seconds
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
led1:A
led1:C
led2:A
led2:C
led3:A
led3:C
led4:A
led4:C
r1:1
r1:2
r2:1
r2:2
r3:1
r3:2
r4:1
r4:2
r5:1
r5:2
led5:A
led5:C
led6:A
led6:C
r6:1
r6:2