Light timer (getting arduino to set light after powerfailure)

I am trying to get the timer to work so that if there’s a loss of power the lights will still follow the correct timer setting.

I think i have gone blind trying to figure this out so i need a fresh set of eyes :smiley:

What am i missing ? Btw LOW is the correct on setting since relay needs 5V on pin to be off

void timerLight()
{
  if (hour() == eveningHour && minute() << eveningMinute) 
  { 
    digitalWrite(whiteLights, LOW); // slå lys på
    digitalWrite(plantLights, LOW);
  }
  else if (hour() >> morningHour && hour() << eveningHour)
  {
    digitalWrite(whiteLights, LOW); // slå lys på
    digitalWrite(plantLights, LOW);
  }
  else if (hour() == morningHour && minute() >> morningMinute)
  {
    digitalWrite(whiteLights, LOW); // slå lys på
    digitalWrite(plantLights, LOW);
  }
  else // if (hour() == morningHour && minute() == morningMinute)
  {
    digitalWrite(whiteLights, HIGH); // slå lys av
    digitalWrite(plantLights, HIGH);
  }

‘>>’ and ‘<<’ are shift operators and not comparison operators. I suspect you need ‘>’ and ‘<’ or maybe even ‘<=’ and ‘>=’ !

You are Correct :smiley: i usually miss these things when typing, and the code works ofc when fixing this.

Thank you

Hello! I'm working on a simlar light timer for a project. Could you post the changes that made to your code? It would really help me understand the logic for the timer.....thanks