Darrel,
Changed the code and it's still not functioning right.
If I set the on time as 15:00 and off time as 15:01 the led comes on at 15:01 and stays on... well past the programmed stop time... any ideas ?
Code:
CheckTimes:
TimeCmpFlags = 0 ; clear flags first
; if the Start and Stop times are the same, then Always OFF
if (lightsetHR[fn]=timeH) AND _
(lightsetMN[fn]=timeM) then AlwaysOFF
; is it past the Start time?
if (timeH>lightsetHR[fn]) OR _
(timeH=lightsetHR[fn] AND timeM >= lightsetMN[fn])then PastStart=1
; is it past the Stop time?
if (timeH>lightoffHR[fn]) OR _
(timeH=lightoffHR[fn] AND timeM >= lightoffMN[fn])then PastStop=1
; does the period end the following day?
if (lightoffHR[fn]< lightsetHR[fn]) OR _
(lightoffHR[fn]=lightsetHR[fn] AND lightoffMN[fn] < lightsetMN[fn]) then NextDay=1
if !NextDay then ; same day, use AND
if PastStart AND !PastStop then ProgON = 1
else ; next day, use OR
IF PastStart OR !PastStop then ProgON = 1
endif
AlwaysOFF:
return
Bookmarks