Syntax Error!
Syklorex
Posts: 4
First off, I'd like to state I'm a complete newb.·Anyways, in Activity 4, chapter 3 of "Robotics with the Boe-Bot" I am getting a syntax error in the example program: "TestServoSpeed.bs2"· Error 129-Expected ':'or end-of-line.·
' {$STAMP BS2}
' {$PBASIC 2.0}
counter VAR Word
pulseWidth VAR Word
pulseWidthComp VAR Word
FREQOUT 4, 2000, 3000
Do
· DEBUG "Enter pulse width: "
· DEBUGIN DEC pulseWidth··················· <
There's the problem, DEC
· pulseWidthComp = 1500 - pulsewidth
· FOR counter = 1 TO 244
··· PULSOUT 12, pulseWidth
··· PULSOUT 13, pulseWidthComp
· NEXT
LOOP
Sorry, but I don't know how to fix a stock example program... I looked up the help menu and it seemed like there is supposed to be a {1...5} in front of the DEC for it to work. And so I did try that, arbitratrily picking the numbers, but·it didn't help.·Does anyone know what is going on? Thanks
' {$STAMP BS2}
' {$PBASIC 2.0}
counter VAR Word
pulseWidth VAR Word
pulseWidthComp VAR Word
FREQOUT 4, 2000, 3000
Do
· DEBUG "Enter pulse width: "
· DEBUGIN DEC pulseWidth··················· <
There's the problem, DEC
· pulseWidthComp = 1500 - pulsewidth
· FOR counter = 1 TO 244
··· PULSOUT 12, pulseWidth
··· PULSOUT 13, pulseWidthComp
· NEXT
LOOP
Sorry, but I don't know how to fix a stock example program... I looked up the help menu and it seemed like there is supposed to be a {1...5} in front of the DEC for it to work. And so I did try that, arbitratrily picking the numbers, but·it didn't help.·Does anyone know what is going on? Thanks
Comments
' {$PBASIC 2.5}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
Post Edited (Syklorex) : 4/2/2005 11:43:19 PM GMT
Is your servo one that has been modified to rotate continuously? Stock servos will only rotate a partial turn and then stop.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Name: Bruce Clemens
Work:· Clemensb@otc.edu
Good Stuff on my Blog: http://theDeadBug.journalspace.com
·· This could be due to your PULSOUT loop missing the PAUSE 20 that should be in there.· Missing something twice in the same code kinda hints that you should always re-check your code against the manual.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com