Shop OBEX P1 Docs P2 Docs Learn Events
Help WAM Ch.3 Activity5 (ReactionTimer.bs2) — Parallax Forums

Help WAM Ch.3 Activity5 (ReactionTimer.bs2)

BS2004BS2004 Posts: 4
edited 2005-09-21 02:17 in Learn with BlocklyProp
I need help with the 5th activity in chapter three of What is a Microcontroller (ReactionTimer.bs2). I copied all the code into the stamp editor exactly as it was written in the book. I've double and triple checked for typos. Whenever i try to run the program an error pops up that says "Expected a constant, variable, unary operator, or '('·". When this message box pops up the program also highlights the first DO written in the program. I read somewhere else on the forums about using a DO WHILE command. I cant find this post now. I have tried using the DO WHILE command instead of the DO comand, which still didn't work. im not sure i did it correctly since this is my first programming experience, and i dont know how to write my own code yet. All i know to do is copy from the book until i learn how the commands are used. I would greatly appreciate if anyone could help me out with this problem. I have tried all i know with no success.

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-09-21 00:54
    Do you have this:

    ' {$PBASIC 2.5}

    ... at the top of your program?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • BS2004BS2004 Posts: 4
    edited 2005-09-21 00:58
    Yes, ' {$PBASIC 2.5} is at the top. I used the tabs at the top to make sure i didnt type any of those in wrong
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-09-21 01:08
    Please attach your code, or better yet, a screenshot showing where it's finding the error.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • BS2004BS2004 Posts: 4
    edited 2005-09-21 01:32
    The code is attached. I wasn't sure how to attach a screen shot but the first DO command was what the error highlighted. It just highlighted the word "DO" and nothing else. none of the words above or below it was highlighted.
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2005-09-21 01:52
    There's a comma at the end of the line preceding it.

    Always look immediately before the error too.

    Tricky one!

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel

    Electronic Systems Technologies
    Southern Illinois University Carbondale
    Personal Links - ·Lot of BASIC Stamp info
    and
    SelmaWare Solutions
    StampPlot Pro Version 3 Release 4
    Graphical Data Acquisition for your Micro and Imagination!
    Now allows additional controls to be added, or developed.
    ·
  • BS2004BS2004 Posts: 4
    edited 2005-09-21 02:17
    WOW, That did it. i would have never found that by myself. Thank You all so much for your help and quick responses
Sign In or Register to comment.