Shop OBEX P1 Docs P2 Docs Learn Events
Syntax Error! — Parallax Forums

Syntax Error!

SyklorexSyklorex Posts: 4
edited 2005-04-03 01:48 in Learn with BlocklyProp
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

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-04-02 23:39
    Change your PBASIC declaration to

    ' {$PBASIC 2.5}

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • SyklorexSyklorex Posts: 4
    edited 2005-04-02 23:40
    Hmm, wow, thanks. I completely forgot I have been using 2.5.

    Post Edited (Syklorex) : 4/2/2005 11:43:19 PM GMT
  • SyklorexSyklorex Posts: 4
    edited 2005-04-03 00:20
    In this same activity, the servos are supposed to rotate for 6 full seconds at pulswidth 650, or 1.3ms . However, it doesn't, it just makes almost one revolution and stops.
  • The Dead BugThe Dead Bug Posts: 73
    edited 2005-04-03 00:39
    Skylorex,
    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
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-04-03 01:48
    Syklorex,

    ·· 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
Sign In or Register to comment.