Saturday, 20 July 2024

Traffic Controller & Flasher

// TRIMAN //
// 26 JULY 2024 //

#include <Wire.h>
#include <EEPROM.h>
#include "RTClib.h"
 #include <Adafruit_I2CDevice.h>
//#include <SPI.h>
 RTC_DS1307 rtc;
 char namaHari[7][12] = {"Minggu", "Senin", "Selasa", "Rabu", "Kamis", "Jumat", "Sabtu"};
#define DS3231_I2C_ADDRESS 0x68
#include <LiquidCrystal_PCF8574.h>
LiquidCrystal_PCF8574 lcd(0x20); 
byte second, minute, hour, day, date, month, year;
  
int addr1 = 0;  
int addr2 = 1;  
int addr3 = 2;  
int addr4 = 3;  
int addr5 = 4;  
int addr6 = 5;  
int addr7 = 6;  
int addr8 = 7;  
int addr9 = 8;  
int addr10 = 9; 
int addr11 = 10;
int addr12 = 11;  
int addr13 = 12;

int ledg1 = 2;  
int ledy1 = 3;  
int ledr1 = 4;  
  
int ledg2 = 5;  
int ledy2 = 6;  
int ledr2 = 7;  
  
int ledg3 = 8;  
int ledy3 = 9;  
int ledr3 = 10; 
  
int ledg4 = 11; 
int ledy4 = 12; 
int ledr4 = 13; 

//int ledy5 = A0; 
//int ledy6 = A1; 

int btset = A1; 
int btup = A3;  
int btdown = A4;  
int btok = A2;  
  
int btsetx = 0; 
int btupx = 0;  
int btdownx = 0;  
int btokx = 0;  

int red = 200;  
int yellow = 200;  
int yellow2 = 200; 
// int zebracross = 0;
  
// Convert normal decimal numbers to binary coded decimal 
byte decToBcd(byte val) 
  return( (val/10*16) + (val%10) ); 
// Convert binary coded decimal to normal decimal numbers 
byte bcdToDec(byte val) 
  return( (val/16*10) + (val%16) ); 
  
int jam,menit,hari,startFlash,endFlash; 
int green1,green2,green3,green4;  

  
void setup()  
   Serial.begin(9600);
  if (! rtc.begin()) {
    Serial.println("RTC TIDAK TERBACA");
    while (1);
  }

  if (! rtc.isrunning()) {
    Serial.println("RTC is NOT running!");
    rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));//update rtc dari waktu komputer
  }

green1 = EEPROM.read(addr1);  
green2 = EEPROM.read(addr2);  
green3 = EEPROM.read(addr3);  
green4 = EEPROM.read(addr4);  
startFlash = EEPROM.read(addr5);  
endFlash = EEPROM.read(addr6);  

lcd.begin(20, 4);
lcd.setBacklight(255);
// lcd.init();                      // inisialisasi the lcd 
lcd.noCursor();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Info: Triman");
lcd.setCursor(4,1);
lcd.print("081389248685");
  delay (300);

lcd.noCursor();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("   TRAFFIC  LIGHT");
lcd.setCursor(0,1);
lcd.print("     CONTROLLER");
lcd.setCursor(0,2);
lcd.print(" Low Voltage System");
lcd.setCursor(0,3);
lcd.print(" Type = TL 6Y40A12");
  delay (1260);

pinMode(ledg1,OUTPUT);  
pinMode(ledy1,OUTPUT);  
pinMode(ledr1,OUTPUT);  
  
pinMode(ledg2,OUTPUT);  
pinMode(ledy2,OUTPUT);  
pinMode(ledr2,OUTPUT);  
  
pinMode(ledg3,OUTPUT);  
pinMode(ledy3,OUTPUT);  
pinMode(ledr3,OUTPUT);  
  
pinMode(ledg4,OUTPUT);  
pinMode(ledy4,OUTPUT);  
pinMode(ledr4,OUTPUT);  


  
pinMode(btset,INPUT_PULLUP);  
pinMode(btup,INPUT_PULLUP); 
pinMode(btdown,INPUT_PULLUP); 
pinMode(btok,INPUT_PULLUP); 

  digitalWrite(ledg1,LOW);
  digitalWrite(ledg2,LOW);
  digitalWrite(ledg3,LOW);
  digitalWrite(ledg4,LOW);

  digitalWrite(ledy1,LOW);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledy4,LOW);
  
  digitalWrite(ledr1,HIGH);
  digitalWrite(ledr2,HIGH);
  digitalWrite(ledr3,HIGH);
  digitalWrite(ledr4,HIGH);
    delay(1500);
lcd.noCursor();
lcd.clear();
lcd.setCursor(0,0);
lcd.print("   TRAFFIC  LIGHT");
lcd.setCursor(0,1);
lcd.print("     CONTROLLER");
lcd.setCursor(0,2);
lcd.print(" Low Voltage System");
lcd.setCursor(0,3);
lcd.print(" Type = TL 6Y40A12");
  delay (1260);
  
  digitalWrite(ledr1,LOW);
  digitalWrite(ledr2,LOW);
  digitalWrite(ledr3,LOW);
  digitalWrite(ledr4,LOW);
     delay(100);
   digitalWrite(ledr1,HIGH);
  digitalWrite(ledr2,HIGH);
  digitalWrite(ledr3,HIGH);
  digitalWrite(ledr4,HIGH);
    delay(100);
  digitalWrite(ledr1,LOW);
  digitalWrite(ledr2,LOW);
  digitalWrite(ledr3,LOW);
  digitalWrite(ledr4,LOW);
     delay(100);
  digitalWrite(ledr1,HIGH);
  digitalWrite(ledr2,HIGH);
  digitalWrite(ledr3,HIGH);
  digitalWrite(ledr4,HIGH);
    delay(100);


 
  Wire.begin(); 
  // set the initial time here: 
  // DS3231 seconds, minutes, hours, day, date, month, year 
// setDS3231time(0,12,1,2,25,11,23);  //===================================
  startFlash = 22;  //=======================================================
  endFlash = 6;  //=========================================================
    green1 = 3000;  //=========================================================
    green2 = 2500;  //=========================================================
    green3 = 3000;  //=========================================================
    green4 = 2500;  //=========================================================
    
btsetx = digitalRead(btset);  
if(btsetx == 0) 
   lcd.clear();   
   green1 = 0;  
   green2 = 0;  
   green3 = 0;  
   green4 = 0;  
    
   startFlash = 0;  
   endFlash = 0;  
    
//   settingjam();  
//   settingmenit();  
//   settinghari(); 
  // setzebracross(); 
  setdelaygreen1(); 
  setdelaygreen2(); 
  setdelaygreen3(); 
   setdelaygreen4();  
   setstartFlash(); 
   setendFlash(); 
   EEPROM.write(addr1, green1); 
   EEPROM.write(addr2, green2); 
   EEPROM.write(addr3, green3); 
   EEPROM.write(addr4, green4); 
   EEPROM.write(addr5, startFlash); 
   EEPROM.write(addr6, endFlash); 
  // DS3231 seconds, minutes, hours, day, date, month, year 
// setDS3231time(0,10,1,hari,25,11,23);  
}   
    
  
  
void setDS3231time(byte second, byte minute, byte hour, byte day, byte  
date, byte month, byte year)  
  // sets time and date data to DS3231  
  Wire.beginTransmission(DS3231_I2C_ADDRESS); 
  Wire.write(0); // set next input to start at the seconds register 
  Wire.write(decToBcd(second)); // set seconds  
  Wire.write(decToBcd(minute)); // set minutes  
  Wire.write(decToBcd(hour)); // set hours  
  Wire.write(decToBcd(day)); // set day of week (1=Sunday, 7=Saturday)  
  Wire.write(decToBcd(date)); // set date (1 to 31) 
  Wire.write(decToBcd(month)); // set month 
  Wire.write(decToBcd(year)); // set year (0 to 99) 
  Wire.endTransmission(); 
void readDS3231time(byte *second, 
byte *minute, 
byte *hour, 
byte *day,  
byte *date, 
byte *month,  
byte *year) 
  Wire.beginTransmission(DS3231_I2C_ADDRESS); 
  Wire.write(0); // set DS3231 register pointer to 00h  
  Wire.endTransmission(); 
  Wire.requestFrom(DS3231_I2C_ADDRESS, 7);  
  // request seven bytes of data from DS3231 starting from register 00h 
  *second = bcdToDec(Wire.read() & 0x7f); 
  *minute = bcdToDec(Wire.read());  
  *hour = bcdToDec(Wire.read() & 0x3f); 
  *day = bcdToDec(Wire.read()); 
  *date = bcdToDec(Wire.read());  
  *month = bcdToDec(Wire.read()); 
  *year = bcdToDec(Wire.read());  


void displayTime()  
 lcd.clear(); 
 lcd.clear(); 
  lcd.setCursor(0,0); 
  // retrieve data from DS3231  
  readDS3231time(&second, &minute, &hour, &day, &date, &month,  
  &year); 
  // send it to the serial monitor  
  lcd.print(hour, DEC);
  lcd.print(":"); 
  if (minute<10)  
  { 
    lcd.print("0"); 
  } 
  lcd.print(minute, DEC); 

lcd.setCursor(6,0);  
  lcd.print("WIB");
lcd.setCursor(10,0);  
  lcd.print(date, DEC);
  lcd.print("/");
  lcd.print(month, DEC);
  lcd.print("/20");
  lcd.print(year, DEC);

  lcd.setCursor(0,1);
  lcd.print(date, DEC);
  lcd.print("/");
  
  lcd.setCursor(3,1);
  lcd.print(month, DEC);
  lcd.print("/20");
  lcd.print(year, DEC);
  lcd.setCursor(13,1);
  lcd.print("  3M-RH01");

//lcd.setCursor(0,2);
// lcd.print("Info:081389248685");


lcd.setCursor(0,1);
lcd.print("Flash = "); 
lcd.print(startFlash);  
lcd.print("-"); 
lcd.print(endFlash);  

lcd.setCursor(0,2);
lcd.print("G1=");  
lcd.print(green1);  
lcd.print("");  

lcd.setCursor(10,2);
lcd.print("G2=");  
lcd.print(green2);  
lcd.print("");  

lcd.setCursor(0,3);
lcd.print("G3=");  
lcd.print(green3);  
lcd.print("");  

lcd.setCursor(10,3);
lcd.print("G4=");  
lcd.print(green4);  
lcd.print("");  

void displayTime2() 
 lcd.clear(); 
 lcd.clear(); 
  lcd.setCursor(0,0); 
  // retrieve data from DS3231  
  readDS3231time(&second, &minute, &hour, &day, &date, &month,  
  &year); 
  // send it to the serial monitor  
  lcd.print(hour, DEC);
  lcd.print(":"); 
  if (minute<10)  
  { 
    lcd.print("0"); 
  } 
  lcd.print(minute, DEC); 
/*  lcd.print(":"); 
  
  if (second<10)  
  { 
    lcd.print("0"); 
  } 
//  lcd.print(second, DEC); 

*/
lcd.setCursor(6,0);  
  lcd.print("WIB");
lcd.setCursor(10,0);  
  lcd.print(date, DEC);
  lcd.print("/");
  lcd.print(month, DEC);
  lcd.print("/20");
  lcd.print(year, DEC);

  lcd.setCursor(0,1);
  lcd.print("Flash = ");
  lcd.print(startFlash);
  lcd.print("-");
  lcd.print(endFlash);
  lcd.setCursor(13,1);
  lcd.print("WIB");

  lcd.setCursor(0,2);
  lcd.print("     Taman Kota");
//  lcd.print(yelHIGH);
//  lcd.print("");

  lcd.setCursor(0, 3);
  lcd.print("ROKAN HULU   3M-RH01");


void loop() 
    DateTime now = rtc.now();
    Serial.print(namaHari[now.day()]);  
    Serial.print(',');    
    Serial.print(now.day(), DEC);
    Serial.print('/');
    Serial.print(now.month(), DEC);
    Serial.print('/');
    Serial.print(now.year(), DEC);
    Serial.print(" ");   
    Serial.print(now.hour(), DEC);
    Serial.print(':');
    Serial.print(now.minute(), DEC);
    Serial.print(':');
    Serial.print(now.second(), DEC);
    Serial.println();
    
Serial.print("startFlash= "); 
Serial.print(startFlash); 
Serial.print("   ");  

Serial.print("endFlash= "); 
Serial.print(endFlash); 
Serial.print("   ");  

// Serial.print("delayyellow= ");  
// Serial.print(yelHIGH); 
// Serial.print("   ");  
    delay(100);

//   displayTime(); 
//   delay(10); 
   
   displayTime2(); 
//      delay(10); 

  //JALURl 1   
  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,HIGH);
  digitalWrite(ledr1,LOW);
  delay(yellow);

  digitalWrite(ledg1,HIGH);
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,LOW);
  
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,HIGH);
  
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,HIGH);
  
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,HIGH);
  delay(green1);

  //yellow Jalan 1 
  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,HIGH);
  //digitalWrite(ledr1,LOW);
  delay(yellow2);

  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,HIGH);
  delay(red);

  /* / ZEBRA
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,HIGH);
  digitalWrite(ledg0,HIGH);
  digitalWrite(ledr0,LOW);
  delay(zebracross);
  digitalWrite(ledg0,LOW);
  digitalWrite(ledr0,HIGH);
*/
  //JALURl 2   
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,HIGH);
  digitalWrite(ledr2,LOW);
  delay(yellow);

  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,HIGH);
  
  digitalWrite(ledg2,HIGH);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,LOW);
  
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,HIGH);
  
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,HIGH);
  delay(green2);

  //yellow Jalan 2 
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,HIGH);
//  digitalWrite(ledr2,LOW);
  delay(yellow2);

  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,HIGH);
  delay(red);

  /* / ZEBRA
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,HIGH);
  digitalWrite(ledg0,HIGH);
  digitalWrite(ledr0,LOW);
  delay(zebracross);
  digitalWrite(ledg0,LOW);
  digitalWrite(ledr0,HIGH);
*/

  //JALURl 3   
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,HIGH);
  digitalWrite(ledr3,LOW);
  delay(yellow);

  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,HIGH);
  
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,HIGH);
  
  digitalWrite(ledg3,HIGH);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,LOW);
  
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,HIGH);
  delay(green3);

  //yellow Jalan 3 
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,HIGH);
//  digitalWrite(ledr3,LOW);
  delay(yellow2);

  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,HIGH);
  delay(red);

  /* / ZEBRA
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,HIGH);
  digitalWrite(ledg0,HIGH);
  digitalWrite(ledr0,LOW);
  delay(zebracross);
  digitalWrite(ledg0,LOW);
  digitalWrite(ledr0,HIGH);
*/

  //JALURl 4   
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,HIGH);
  digitalWrite(ledr4,LOW);
  delay(yellow);
  
  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,HIGH);
  
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,HIGH);
  
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,HIGH);
  
  digitalWrite(ledg4,HIGH);
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,LOW);
  delay(green4);

  //yellow Jalan 4 
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,HIGH);
//  digitalWrite(ledr4,LOW);
  delay(yellow2);

  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,HIGH);
  delay(red);

  /* / ZEBRA
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,HIGH);
  digitalWrite(ledg0,HIGH);
  digitalWrite(ledr0,LOW);
  delay(zebracross);
  digitalWrite(ledg0,LOW);
  digitalWrite(ledr0,HIGH);
*/
if(hour == startFlash){ 
runFlash(); 
        
  
  
void settingjam(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("Jam = ");  
lcd.print(jam); 
lcd.print("   "); 
  
if(btupx == 0){ 
delay(10);  
jam++;  
if(btdownx == 0){ 
delay(10);  
jam--;  
  
if(jam > 23){ 
jam = 0;  
  
if(jam < 0){  
jam = 23; 
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
return; 
    
settingjam();   
  
  
void settingmenit(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("menit = ");  
lcd.print(menit); 
lcd.print("   "); 
  
if(btupx == 0){ 
menit++;  
if(btdownx == 0){ 
menit--;  
  
if(menit > 59){ 
menit = 0;  
  
if(menit < 0){  
menit = 59; 
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
return; 
    
settingmenit();   
  
  
  
void settinghari(){ 
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("hari= ");  
  
if(hari == 1){  
lcd.print("senin     ");  
if(hari == 2){  
lcd.print("selasa   "); 
if(hari == 3){  
lcd.print("rabu     "); 
if(hari == 4){  
lcd.print("kamis    "); 
if(hari == 5){  
lcd.print("jumat     ");  
if(hari == 6){  
lcd.print("sabtu    "); 
if(hari == 7){  
lcd.print("minggu    ");  
  
if(btupx == 0){ 
hari++; 
if(btdownx == 0){ 
hari--; 
  
if(hari < 1){ 
hari = 7; 
  
if(hari > 7){ 
hari = 1; 
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
return; 
    
settinghari();    
  
  
  
void setdelaygreen1(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("G1= ");  
lcd.print(green1);  
lcd.print("   "); 
  
if(btupx == 0){ 
green1++; 
if(btdownx == 0){ 
green1--; 
  
if(green1 < 1){ 
green1 = 1; 
  
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
green1 = green1 * 100;  
return; 
    
setdelaygreen1();   
  
  
  
void setdelaygreen2(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("G2= ");  
lcd.print(green2);  
lcd.print("   "); 
  
if(btupx == 0){ 
green2++; 
if(btdownx == 0){ 
green2--; 
  
if(green2 < 1){ 
green2 = 1; 
  
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
green2 = green2 * 100;  
return; 
    
setdelaygreen2();   
  
  
void setdelaygreen3(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("G3= ");  
lcd.print(green3);  
lcd.print("   "); 
  
if(btupx == 0){ 
green3++; 
if(btdownx == 0){ 
green3--; 
  
if(green3 < 1){ 
green3 = 1; 
  
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
green3 = green3 * 100;  
return; 
    
setdelaygreen3();   
  
  
void setdelaygreen4(){  
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("G4= ");  
lcd.print(green4);  
lcd.print("   "); 
  
if(btupx == 0){ 
green4++; 
if(btdownx == 0){ 
green4--; 
  
if(green4 < 1){ 
green4 = 1; 
  
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
green4 = green4 * 100;  
return; 
    
setdelaygreen4();   
  
  
  
void setstartFlash(){ 
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("startFlash= ");  
lcd.print(startFlash);  
lcd.print("   "); 
  
if(btupx == 0){ 
startFlash++; 
if(btdownx == 0){ 
startFlash--; 
  
if(startFlash < 0){ 
startFlash = 23;  
  
if(startFlash > 23){  
startFlash = 0; 
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
return; 
    
setstartFlash();    
  
  
void setendFlash(){ 
  
btokx = digitalRead(btok);  
btupx = digitalRead(btup);  
btdownx = digitalRead(btdown);  
  
lcd.setCursor(0,0); 
lcd.print("endFlash= ");  
lcd.print(endFlash);  
lcd.print("   "); 
  
if(btupx == 0){ 
endFlash++; 
if(btdownx == 0){ 
endFlash--; 
  
if(endFlash < 0){ 
endFlash = 23;  
  
if(endFlash > 23){  
endFlash = 0; 
  
if(btokx == 0){ 
lcd.clear();  
delay(100); 
return; 
    
setendFlash();    
  
  
  
  
void runFlash(){  
    
displayTime2(); 
delay(100); 
    
  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,HIGH);
  digitalWrite(ledr1,LOW);
  
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,HIGH);
  digitalWrite(ledr2,LOW);
  
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,HIGH);
  digitalWrite(ledr3,LOW);
  
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,HIGH);
  digitalWrite(ledr4,LOW);

  
  delay(1000);
  
  digitalWrite(ledg1,LOW);
  digitalWrite(ledy1,LOW);
  digitalWrite(ledr1,LOW);
  
  digitalWrite(ledg2,LOW);
  digitalWrite(ledy2,LOW);
  digitalWrite(ledr2,LOW);
  
  digitalWrite(ledg3,LOW);
  digitalWrite(ledy3,LOW);
  digitalWrite(ledr3,LOW);
  
  digitalWrite(ledg4,LOW);
  digitalWrite(ledy4,LOW);
  digitalWrite(ledr4,LOW);


  delay(1000);
  
if(hour == endFlash){ 
return; 
  
runFlash(); 

No comments:

Post a Comment