Hi, so i'm making a simple alarm system using arduino+buzzer+keypad+lcd
i want to make a timer for the alarm using RTC_DS1307 (as in it works for a set time of day)
what i can't figure out is how to write it correctly. i have
if (Alarmactive) {
if (now.hour() >= Start && now.hour() <= End)
but i don't know how to add minutes and days to this statement
also i want the timer to be changeable. i have
int x, y, hour ;
tone(BUZZ, 2000, 100);
lcd.clear();
lcd.setCursor(0,0);
lcd.print("START");
lcd.setCursor(0,1);
key = pad.getKey();
if (key != NO_KEY){
if (key == '0' || key == '1' || key == '2' || key == '3' ||
key == '4' || key == '5' || key == '6' || key == '7' ||
key == '8' || key == '9' ) {
hour += key;
lcd.setCursor(x,1);
lcd.print("*");
x++;
}
}
lcd.clear();
lcd.setCursor(0,0);
lcd.print("END");
lcd.setCursor(0,1);
if (key != NO_KEY){
if (key == '0' || key == '1' || key == '2' || key == '3' ||
key == '4' || key == '5' || key == '6' || key == '7' ||
key == '8' || key == '9' ) {
hour += key;
lcd.setCursor(y,1);
lcd.print("*");
y++;
}
}
}
first is this correct and second how would i add the minutes and days
Thanks