#AUTHOR IS ARMATH ENGENEERING LABORATORIE OF ARINJ
int GREEN = 2;
int YELLOW = 3;
int RED = 4;
int green = 5;
int red = 6;
void setup()
{
pinMode(GREEN, OUTPUT);
pinMode(YELLOW, OUTPUT);
pinMode(RED, OUTPUT);
pinMode(green, OUTPUT);
pinMode(red, OUTPUT);
}
void loop()
{
green_light();
delay(5000);
yellow_light();
delay(2000);
red_light();
delay(5000);
green_light();
delay(5000);
red_light();
delay(5000);
}
void green_light()
{
digitalWrite(GREEN, HIGH);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, LOW);
digitalWrite(green, LOW);
digitalWrite(red, HIGH);
}
void yellow_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, HIGH);
digitalWrite(RED, LOW);
}
void red_light()
{
digitalWrite(GREEN, LOW);
digitalWrite(YELLOW, LOW);
digitalWrite(RED, HIGH);
digitalWrite(green, HIGH);
digitalWrite(red, LOW);
}
Comments