#include "RTClib.h"
RTC_DS1307 rtc;
char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"};
void setup () {
Serial.begin(115200);
if (! rtc.begin()) {
Serial.println("Couldn't find RTC");
Serial.flush();
abort();
}
pinMode(10, OUTPUT); // green
pinMode(11, OUTPUT); // blue
pinMode(12, OUTPUT); // RED
}
void loop () {
DateTime now = rtc.now();
// Serial.print("Current time: ");
// Serial.print(now.year(), DEC);
// Serial.print('/');
// Serial.print(now.month(), DEC);
// Serial.print('/');
// Serial.print(now.day(), DEC);
// Serial.print(" (");
// Serial.print(daysOfTheWeek[now.dayOfTheWeek()]);
// Serial.print(") ");
// Serial.print(now.hour(), DEC);
// Serial.print(':');
// Serial.print(now.minute(), DEC);
// Serial.print(':');
// Serial.print(now.second(), DEC);
// Serial.println();
int sec = now.second();
int hour = now.hour();
int minute = now.minute();
Serial.print(hour);
Serial.print("/");
Serial.print(minute);
Serial.print("/");
Serial.println(sec);
// Adjust tine in 24-Hour Format to Start LED light
if(hour == 23 and minute == 16 and sec == 40) {
digitalWrite(12,HIGH);
// delay(4000);
}
// Adjust time in 24-hours to stop/Dim LED light
if(hour == 23 and minute == 16 and sec == 50)
{
digitalWrite(12,HIGH);
}
delay(1000);
// digitalWrite(12, 1);
}