Error: "Expected a Label" - bs2 from the 'whats a microcontroller' kit
Kris1
Posts: 5
in BASIC Stamp
Hi folks,
Noobie here I recently picked up parallax's 'whats a microcontroller' book/kit and am having a lot of fun learning how to program these controllers. I am working with the "readpushbuttonstate.bs2" program. When i run the program, i get "error 148:Expected a label" after the THEN statement. Below is my code and my pc specs.
Any thoughts on what i should be modifying? It looks identical to what is in the book (page 72).
Thank you for your help!
Noobie here I recently picked up parallax's 'whats a microcontroller' book/kit and am having a lot of fun learning how to program these controllers. I am working with the "readpushbuttonstate.bs2" program. When i run the program, i get "error 148:Expected a label" after the THEN statement. Below is my code and my pc specs.
Win 7 64bit
Basic Stamp 2.5.3
USB connection
Basic Stamp 2.5.3
USB connection
'{PBASIC 2.5} '{$STAMP BS2} DO DEBUG ? IN3 IF (IN3 = 1) THEN HIGH 14 PAUSE 50 LOW 14 PAUSE 50 ELSE PAUSE 100 ENDIF LOOP
Any thoughts on what i should be modifying? It looks identical to what is in the book (page 72).
Thank you for your help!
Comments
Instead of typing these in, you can click an icon in the toolbar which will insert them correctly.
Edit: corrected first line.
Kris1,
That error is indicative of having the {$PBASIC 2.0} directive instead of {$PBASIC 2.5}.
PBASIC 2.0 only supports a THEN to a label, where 2.5 supports a THEN to an action.
I don't have a Stamp here at work to verify what Sapphire said, but the toekenization of the directives with/without a space between the single quote and the left brace made no difference.