Troubleshooting Basic Stamp Board I code to Homework Board
abstractj
Posts: 3
I tried to run the below code in my homework board and got the following error:
lable is missing ';'
SYMBOL in SYMBOL Servo_pin = 0 is highlighted
I've tried running in Stamp 2.0 and still did not work.
The above code was taken from RoboSheep project:
http://www.2robots.com/2006/10/21/robosheep/
Thanks for helping.
lable is missing ';'
SYMBOL in SYMBOL Servo_pin = 0 is highlighted
‘ {$STAMP BS1} ‘ {$PBASIC 1.0} SYMBOL Servo_pin = 0 SYMBOL Temp = W0 SYMBOL Temp2 = W1 SYMBOL Rand = W2 SYMBOL RSensor = PIN1 SYMBOL LSensor = PIN2 Init: Rand = 55 Main: RANDOM Rand Rand = Rand // 8 Rand = Rand + 8 PAUSE 2300 Temp = RSensor Temp2 = LSensor DEBUG Temp, Temp2, ” “ IF Temp = Temp2 THEN Center IF Temp > Temp2 THEN Right GOTO Left Right: DEBUG “Right” FOR temp = 0 TO Rand PULSOUT Servo_pin,120 PAUSE 30 NEXT GOTO Main Left: DEBUG “Left” FOR temp = 0 TO Rand PULSOUT Servo_pin,190 PAUSE 30 NEXT GOTO Main Center: ‘FOR temp = 0 TO 2 ‘PULSOUT Servo_pin,150 ‘PAUSE 20 ‘NEXT GOTO Main
I've tried running in Stamp 2.0 and still did not work.
The above code was taken from RoboSheep project:
http://www.2robots.com/2006/10/21/robosheep/
Thanks for helping.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
I didn't see the SYMBOL syntax in the PBASIC sytax guide. I wish there is some type of tool that can convert SB I to SB II code standard...
Franklin,
The error happens in line 4.
SYMBOL·Servo_pin·=·0
Thanks,
Joel
That is listed un Memory and Variables under Defining Variables. This is different for the BS2, which uses the format:
Servo_pin VAR Byte
Or
Servo_pin CON 0 (If you’re defining a constant)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Basic Stamp 1 Code:
Would look like this in BSBII:
Am I getting wamer with this?
Everything looks good. If you were using PBASIC 2.5 you could set up the I/O declarations as follows:
RSensor PIN 1
LSensor PIN 2
Take care.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support