Problem with Editor
mwlaursen
Posts: 7
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
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
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
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
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.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
'{$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
No "debug" in front of one of your statements
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.
I need to get my eye fix so I see better.
Thanks again!!!