Condition False even though True
Lightfoot
Posts: 228
Something is acting fishy. The condition I have is not registering as true even though it is.
The current hour (currentHr) of the clock is 19 and outa[noparse][[/noparse]16] should go high when the clock hits 19:33. It does not.
What is up?
The application is a lights timer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
repeat CLK.Set(19, 32, 50) 'Set clock, 19:00 hours, 32 minutes past 19:00, 50 seconds currentHr := CLK.CurrentHour currentMin := CLK.CurrentMinute if currentHr >= 19 and currentHr <= 19 and currentMin >= 32 and currentMin <= 34 outa[noparse][[/noparse]16]~~ else outa[noparse][[/noparse]16]~
The current hour (currentHr) of the clock is 19 and outa[noparse][[/noparse]16] should go high when the clock hits 19:33. It does not.
What is up?
The application is a lights timer.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Comments
SPIN can be a bit awkward sometimes. Replace >= with => (the former is an assignment, the latter the comparison) and <= with =<.
Post Edited (kuroneko) : 6/13/2010 12:10:05 AM GMT
At first Spin's assignment operators just seemed weird, but now they make perfect sense. You just have to see the pattern. They're the logical extension of already familiar operators.
Tom.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Catalina - a FREE C compiler for the Propeller - see Catalina