error message
SAMYTRIX
Posts: 11
I'm typing in a simple code such as the following and I get an error "Expected a variable, text, or a DEBGUG command" and it highlights the DEC command, when I try to run the code:
' {$STAMP BS1}
' {$PBASIC 1.0}
' What's a Microcontroller - FirstProgramYourTurn.bs1
' BASIC Stamp sends messages to Debug Terminal.
DEBUG "Hello, this is your BASIC Stamp!"
DEBUG CR, "What's 7 X 11?"
DEBUG CR, "The answer is: "
DEBUG DEC 7*11
' {$STAMP BS1}
' {$PBASIC 1.0}
' What's a Microcontroller - FirstProgramYourTurn.bs1
' BASIC Stamp sends messages to Debug Terminal.
DEBUG "Hello, this is your BASIC Stamp!"
DEBUG CR, "What's 7 X 11?"
DEBUG CR, "The answer is: "
DEBUG DEC 7*11
Comments
Post Edited (PJ Allen) : 3/26/2006 2:26:36 PM GMT
FYI the What's a Micontroller book was written for a BS2. Many of the programs in the book won't work on a BS1.
SYMBOL A = 7
SYMBOL B = 11
SYMBOL C = B4
DEBUG "Hello, this is your BASIC Stamp!"
DEBUG CR, "What's 7 X 11?"
DEBUG CR, "The answer is: "
C = A * B
DEBUG CR, C
and I got 77. Is that a correct coding?
I edited my program, where I'd had· C = A * C instead of A * B.
Am I all messed up?· My BS1 is all tied up doing something else right now.
Yours is "correct", but the A and B are constants instead of variables, if you're good with that then so am I.
Post Edited (PJ Allen) : 3/26/2006 2:37:54 PM GMT
There are also many other sources for Servo's - use Google to find them.