
Originally Posted by
DavidK
I know it is late and maybe that is the problem. I am trying to run multiple IF-THEN statements. Individually they work fine, but combining them does not. The combined statements assemble fine. BTW, I am reading a clock chip and after every minute rollover, I cycle a cooling fan approx 7 seconds at the 0 second point and 30 second point. I may have to adjust this time (or increase the number of cycles) so I want to be flexible. Where am I missing it?
IF (rtcsec >= $00) AND (rtcsec <= $07) THEN
portb.7 = 1
IF (rtcsec >= $30) AND (rtcsec <= $37) THEN
portb.7 = 1
ELSE
portb.7 = 0
ENDIF
ENDIF
Here is why yours did not work - all I did was format your IF-Thens
Code:
IF (rtcsec >= $00) AND (rtcsec <= $07) THEN
portb.7 = 1
IF (rtcsec >= $30) AND (rtcsec <= $37) THEN
portb.7 = 1
ELSE
portb.7 = 0
ENDIF
ENDIF
As you can see in order for the code to reach your between 30-37 check, the first condition must be true (between 0-7) - go with Jerson's version or two separate checks like you said you had working.
Paul Borgmeier
Salt Lake City, UT
USA
__________________
Bookmarks