That looks pretty good Malc.
And nope, you don't need arrays for the flag bits.
I don't think you should have anything in the AlwaysOFF section, since the CheckTimes routine just determines if it's inside the program period or not.
With multiple time periods, whatever is in AlwaysOFF would happen to both periods if only triggered in one of them.
Any actions can be done after returning from the subroutine.
Something like this in the main loop maybe.
Code:
fn = 0 ; select the first Lights
GOSUB CheckTimes ; compare the programed period
IF ProgON THEN ; If in the program period
IF Lights1 = 0 THEN Lights1 = 1 ; Turn light on (if off)
ELSE
IF Lights1 = 1 THEN Lights1 = 0
ENDIF
; -----------------------------------
fn = 1 ; select the second Lights
GOSUB CheckTimes ; compare the programed period
IF ProgON THEN
IF Lights2 = 0 THEN Lights2 = 1
ELSE
IF Lights2 = 1 THEN Lights2 = 0
ENDIF
Bookmarks