time alarm example

Hi
Arduino mega
Nixon enhanced touchscreen
ds1307

time alarm example
I have been trying to turn on turn off and LED light to no luck.
Look on Internet and your forum I still can't figure out what I am doing wrong.
pinMode(led,OUTPUT,); LED light lights up but stays lit.
My goal is to turn on light at 5 PM turn off light at 5 in the afternoon daily. And have one weekly event and one monthly event.
The daily event is to control dht22 sensor but I need the sensor to turn on and off the light according to humidity and temperature.
So do I need and IF statement and how.
As usual thanks for all your help and advice
Paul.

aaaaaa.txt (2.59 KB)

(deleted)

(deleted)

spycatcher2k:

Serial.println("turn on at 9:00"); 

digitalWrite( led,HIGH);

thanks