Time comparison


Closed Thread
Results 1 to 21 of 21

Thread: Time comparison

Hybrid View

  1. #1
    malc-c's Avatar
    malc-c Guest


    Did you find this post helpful? Yes | No

    Default

    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
    Last edited by malc-c; - 28th July 2010 at 10:17. Reason: update - feedback on performance

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts