Thanks guys,
Darrel, I'll give that a whirl later this morning.... and will report back if I have any issues
Love the look of that simulator.... nice layout
Thanks for the support
Edit - Just tried it by setting the current time to 8:15 and then setting the lighting to come on at 8:09 and off at 8:20 and when run it works fine - have also tried it with the clock set to 23:58 and a lighting period of 23:59 to 00:01 and that works too - Thanks DT
However.....
I can't get the display to show when the lights are on...
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
IF Lights1 = 1 LCDOut $FE, $94+9,"Light 1 ON"
ELSE
IF Lights1 = 1 THEN Lights1 = 0
IF Lights1 = 0 LCDOut $FE, $94+9," "
ENDIF
fn = 1 ; select the second Lights
GOSUB CheckTimes ; compare the programed period
IF ProgON THEN
IF Lights2 = 0 THEN Lights2 = 1
LCDOut $FE, $94+9,"Light 2 ON"
ELSE
IF Lights2 = 1 THEN Lights2 = 0
LCDOut $FE, $94+9," "
ENDIF
if Lights1 = 1 and Lights2 = 1 then
LCDOut $FE, $94+9,"Lights ON"
ELSE
LCDOut $FE, $94+9," "
Endif
The value for Lights1 or Lights2 changes from 0 to 1 as the corresponding LED on the development board lights up or turns off according to the value, but the IF Lights1 = 1 LCDOut $FE, $94+9,"Light 1 ON" or IF Lights1 = 1 THEN LCDOut $FE, $94+9,"Light 1 ON" seems to be ignored
Bookmarks