#include <RTClib.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C Icd(0x27, 20, 4);
RTC_DS1307 rts;
String text1 = "";
int notes[] = {392, 311, 466, 587, 622};
int times[] = {350, 250, 100, 700, 450};
String alarm_hour = "13";
int alarm_minute = "55";
void setup()
{
Serial.begin(9600);
Serial.println("Input time (hour:minute:second):/n");
Icd.init();
pinMode(8, OUTPUT);
if (Irts.begin())
{
while (1);
}
{
void loop()
{
DateTime now = rtc.now();
String year, month, day, hour, minute, second;
year = now year();
month = now.month();
day = now.day();
hour = now.hour();
minute = now.minute();
second = now.second();
String time = hour + ":" + minute + ":" + second;
String date = "Date;" + year + '/' + month + '/' + day;
String current_time = "Time:" + time;
Icd.setCursor(2,1);
Icd.print(date);
Icd.setCursor(2, 2);
Icd.print(current_time);
if (hour == alarm hour && minute == alarm_minute)
{
for (int i = 0; i < 5; i++)
{
tone(8, notes [i], times [i]);
delay(time[i]);
notone(8);
}
}
}