Shop OBEX P1 Docs P2 Docs Learn Events
Problem with Editor — Parallax Forums

Problem with Editor

mwlaursenmwlaursen Posts: 7
edited 2011-10-28 08:14 in BASIC Stamp
Do
DEBUG "Enter run time as a ",CR
DEBUG "number of pulses: "
DEBUGIN DEC pulses


DEBUG "enter Position as a",CR,
"PULSOOUT Duration: "
DEBUGIN DEC duration

image.tiff

I am getting this error when I try to send the program to the board.

The continuation after the CR, gets an error. And it does not understand DEBUGIN either?

New to this homework board.

Thanks

Mark Laursen

Comments

  • Mike GMike G Posts: 2,702
    edited 2011-10-25 18:23
    I can't find anything wrong with your code other than the DO is missing a LOOP. Post all you code.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    
    duration  VAR   Word
    pulses    VAR   Word
    
    DO
      DEBUG "Enter run time as a " ,CR
      DEBUG "number of pulses:"
      DEBUGIN DEC pulses
    
    
      DEBUG "enter Position as a", CR,
      "PULSOOUT Duration: "
      DEBUGIN DEC duration
    LOOP
    
  • FranklinFranklin Posts: 4,747
    edited 2011-10-25 18:47
    Which version on the editor are you running? Get the latest from the website. It compiles OK on my computer.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2011-10-26 08:12
    Mark,

    Your picture doesn't show up for me and you did not say what the error was so I am going to go based on the code you posted. There are several issues with the code you posted that will return errors:
    • No Stamp Directive
    • No Syntax Directive, default is 2.0 which does not support some of the keywords you used. This will generate errors.
    • No LOOP for your DO
    • No variable declarations for your variables (pulses and duration)
    Once these fixes are made the code compiles just fine. Of course I had to guess at the variable sizes, but it is an example. I hope this helps.
    ' {$STAMP BS2}
    ' {$PBASIC 2.5}
    pulses    VAR Word
    duration  VAR Word
    DO
    DEBUG "Enter run time as a ",CR
    DEBUG "number of pulses: "
    DEBUGIN DEC pulses
    
    DEBUG "enter Position as a",CR,
    "PULSOOUT Duration: "
    DEBUGIN DEC duration
    LOOP
    
  • mwlaursenmwlaursen Posts: 7
    edited 2011-10-26 17:41
    Ok, thanks for the replies, here the missing info.

    DEBUG "Enter run time as a ",CR,
    DEBUG "number of pulses: "
    DEBUGIN DEC pulses


    DEBUG "enter Position as a",CR,
    "PULSOOUT Duration: "
    DEBUGIN DEC duration

    The error is : Expected a constant, variable, unary operator. That is for the comma after the CR.

    DEBUG "Enter run time as a ",CR
    DEBUG "number of pulses: "
    DEBUGIN DEC pulses


    DEBUG "enter Position as a",CR
    "PULSOOUT Duration: "
    DEBUGIN DEC duration

    Error Expected ':' or end-of-line for the DEBUGIN, and it high lights the DEC.

    My Version of the editor is 2.5.2
  • mwlaursenmwlaursen Posts: 7
    edited 2011-10-26 17:43
    Sorry I did not post the whole program:

    '{$stamp BS2}
    '{PBASIC 2.5]


    counter VAR Word
    pulses VAR Word
    duration VAR Word


    PAUSE 1000
    DEBUG "Servo Run Time: ",CR
    DEBUG "44 pulses in 1 second",CR
    DEBUG "Servo Position:",CR
    DEBUG " 350 <=PULSOUT Duratin <=1150",CR,CR


    Do
    DEBUG "Enter run time as a ",CR
    DEBUG "number of pulses: "
    DEBUGIN DEC pulses


    DEBUG "enter Position as a",CR
    "PULSOOUT Duration: "
    DEBUGIN DEC duration


    duration = duration MIN 350 MAX 1150


    DEBUG "Servo is running...",CR


    FOR counter = 1 TO pulses
    PULSOUT 14,duration
    PAUSE 20
    NEXT


    DEBUG "done",CR,CR,
    PAUSE 1000


    loop
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2011-10-26 18:45
    mwlaursen,

    attachment.php?attachmentid=78421&d=1297987572

    -Phil
  • FranklinFranklin Posts: 4,747
    edited 2011-10-26 19:27
    Wrong formatting on the $PBASIC tag
    No "debug" in front of one of your statements
    I don't think the problem is with the editor.
  • ercoerco Posts: 20,256
    edited 2011-10-27 10:08
    Franklin wrote: »
    I don't think the problem is with the editor.

    It all depends on your definition of "editor". :)


    ed·i·tor (d-tr) KEY

    NOUN:

    One who edits, especially as an occupation.
  • mwlaursenmwlaursen Posts: 7
    edited 2011-10-28 08:14
    Thanks, it was the '{$PBASIC 2.5}.

    I need to get my eye fix so I see better.

    Thanks again!!!
Sign In or Register to comment.