 //*****************************************
//************ _3_Traffic_Light ************
//*****************************************
// Original code by canalplc
// http://canalplc.blogspot.com.es/
// Version 1.0
// July 2016
//*****************************************
//
int Verde = 2;
int Amarillo = 3;
int Rojo = 4;
int P_Verde = 5;
int P_Rojo = 6;
#include <PC_SIMU.h>
PC_SIMU PLC;
void setup() {
  pinMode(Verde, OUTPUT);
  pinMode(Amarillo, OUTPUT);
  pinMode(Rojo, OUTPUT);
  pinMode(P_Verde, OUTPUT);
  pinMode(P_Rojo, OUTPUT);
  digitalWrite(Verde, 0);
  digitalWrite(Amarillo, 0);
  digitalWrite(Rojo, 0);
  digitalWrite(P_Verde, 0);
  digitalWrite(P_Rojo, 0);
  PLC.INI(); 
}
void loop() {
  digitalWrite(Verde, 1);
  digitalWrite(P_Rojo, 1);
  delay(20000);
  digitalWrite(Verde, 0);
  digitalWrite(Amarillo, 1);
  delay(5000);
  digitalWrite(Amarillo, 0);
  digitalWrite(Rojo, 1);
  delay(2000);
  digitalWrite(P_Rojo, 0);
  digitalWrite(P_Verde, 1);
  delay(10000);
  digitalWrite(P_Verde, 0);
  delay(1000);
  digitalWrite(P_Verde, 1);
  delay(1000);
  digitalWrite(P_Verde, 0);
  delay(1000);
  digitalWrite(P_Verde, 1);
  delay(1000);
  digitalWrite(P_Verde, 0);
  delay(1000);
  digitalWrite(P_Rojo, 1);
  delay(3000);
  digitalWrite(Rojo, 0);
}


