Why do I get a Syntax Error for the ELSE row?
loop2:
ADCIN 0, involt 'Read channel 0 to involt
PAUSE 100 'Wait 100 ms
IF involt >= 128 THEN GPIO.5 = 0
ELSE GPIO.5 = 1 ENDIF
GOTO loop2
END
PIC12F683 & PBP2.60
Why do I get a Syntax Error for the ELSE row?
loop2:
ADCIN 0, involt 'Read channel 0 to involt
PAUSE 100 'Wait 100 ms
IF involt >= 128 THEN GPIO.5 = 0
ELSE GPIO.5 = 1 ENDIF
GOTO loop2
END
PIC12F683 & PBP2.60
ELSE likes to be on a line of it's own.
Try
Code:loop2: ADCIN 0, involt 'Read channel 0 to involt PAUSE 100 'Wait 100 ms IF involt >= 128 THEN GPIO.5 = 0 ELSE GPIO.5 = 1 ENDIF GOTO loop2 END
Dave
Always wear safety glasses while programming.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
IF xxx THEN label
can be on one line because it act as a GOTO.
If not a label the THEN needs to be on a second line.
YUP, I messed up on my first post. Was not paying attention...
Dave
Always wear safety glasses while programming.
************************************************** ***********************
Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
************************************************** ***********************
IF there is the word "Problem" in your question ...
certainly the answer is " RTFM " or " RTFDataSheet " !!!
*****************************************
Bookmarks