Hi, im new to Arduino and im doing some testings with the sketch that its attached and its working great. The problem is that i can only set alarms based on hours.
// Hours that the light is switched on and off
int LightOnHour = 18;
int LightOffHour = 14;// Create alarms that turn on and off the light
Alarm.alarmRepeat(LightOnHour,00,0, LightOnAlarm); // 8:00pm every day
Alarm.alarmRepeat(LightOffHour,00,0,LightOffAlarm); // 11:00am every day// If the light is supposed to be on turn it on
if(hour()<LightOffHour || hour()>=LightOnHour)
{
digitalWrite(LIGHT_PIN, HIGH);
lightState = true;
}
How can i make this code work with more specific time, so i can set hours, minutes ,and seconds?
testA.ino (11.5 KB)