#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C LCD = LiquidCrystal_I2C(0x27, 16, 2);

const int a = 15;
const int b = 2;
const int c = 0;
const int d = 4;
const int e = 16;
const int f = 17;
const int g = 5;
const int dp = 18;
const int red = 12;
const int green = 14;
const int yellow = 25;
void setup() {
  LCD.init();
  LCD.backlight();
 pinMode(a, OUTPUT); 
 pinMode(b, OUTPUT); 
 pinMode(c, OUTPUT); 
 pinMode(d, OUTPUT); 
 pinMode(e, OUTPUT); 
 pinMode(f, OUTPUT); 
 pinMode(g, OUTPUT); 
 pinMode(dp, OUTPUT); 
 pinMode(red, OUTPUT);
 pinMode(green, OUTPUT);
 pinMode(yellow, OUTPUT);
  
}


void loop() 
{

  digitalWrite(yellow, HIGH);
  LCD.clear();
  LCD.setCursor(0, 0);
  LCD.println("TRAFFIC");
  LCD.setCursor(3, 1);
  LCD.println("GET READYY!!!");
  orange();
  digitalWrite(yellow, LOW);
  digitalWrite(red, HIGH);
  LCD.clear();
  LCD.setCursor(3, 1);
  LCD.println("NIRUTHUDAA!!");
  timer();
  digitalWrite(red, LOW);
  digitalWrite(green, HIGH);
  LCD.clear();
  LCD.setCursor(0, 0);
  LCD.println("VANDIYA");
  LCD.setCursor(4,1);
  LCD.println("EDUDA!!");
  timer();
  digitalWrite(green, LOW);
 

}
void orange()
{
  //THREE
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, LOW);
 digitalWrite(f, LOW);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //TWO
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, LOW);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, LOW);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //ONE
 digitalWrite(a, LOW);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, LOW);
 digitalWrite(e, LOW);
 digitalWrite(f, LOW);
 digitalWrite(g, LOW);
 digitalWrite(dp, LOW);
 delay(1000);
 //ZERO
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, HIGH);
 digitalWrite(g, LOW);
 digitalWrite(dp, LOW);
 delay(1000);
}
void timer()
{
  //NEIN
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, LOW);
 digitalWrite(e, LOW);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //EIGHT
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //SEVEN
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, LOW);
 digitalWrite(e, LOW);
 digitalWrite(f, LOW);
 digitalWrite(g, LOW);
 digitalWrite(dp, LOW);
 delay(1000);
 //SIX
 digitalWrite(a, HIGH);
 digitalWrite(b, LOW);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //FIVE
 digitalWrite(a, HIGH);
 digitalWrite(b, LOW);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, LOW);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //FOUR
 digitalWrite(a, LOW);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, LOW);
 digitalWrite(e, LOW);
 digitalWrite(f, HIGH);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //THREE
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, LOW);
 digitalWrite(f, LOW);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //TWO
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, LOW);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, LOW);
 digitalWrite(g, HIGH);
 digitalWrite(dp, LOW);
 delay(1000);
 //ONE
 digitalWrite(a, LOW);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, LOW);
 digitalWrite(e, LOW);
 digitalWrite(f, LOW);
 digitalWrite(g, LOW);
 digitalWrite(dp, LOW);
 delay(1000);
 //ZERO
 digitalWrite(a, HIGH);
 digitalWrite(b, HIGH);
 digitalWrite(c, HIGH);
 digitalWrite(d, HIGH);
 digitalWrite(e, HIGH);
 digitalWrite(f, HIGH);
 digitalWrite(g, LOW);
 digitalWrite(dp, LOW);
 delay(1000);
}