Multiple IF-THEN statements
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
one test only version ...
Hi,
May be we could simplify ...
RTCSEC is ALWAYS >= 0 with PbP ... huh ...
IF ( RTCSEC & $F0) = 0 or 3 ... AND
IF RTCSEC & $0F < 8 ... PortB.7 = 1
Else Portb.7 = 0
so,
IF (( rtcsec & $F0 = 0 ) OR (rtcsec & $F0 = $30 )) AND ( rtcsec & $0F < 8 ) THEN
PORTB.7 = 1
ELSE
PORTB.7 = 0
ENDIF
...
Alain
PS: Hi Sayzer ... you've also got one point !!!