PDA

View Full Version : Easy goto question!



BubbaJoeLouis
02-22-2005, 09:57 AM
Greetings,

Sorry to ask a basic basic stamp question, but why does my goto not work unless I have a debug statement?

' {$STAMP BS2}
OUTPUT 7
beginagain:
DEBUG CLS
TOGGLE 7
PAUSE 200
GOTO beginagain

Causes my LED to blink whereas without the clearscreen command:

' {$STAMP BS2}
OUTPUT 7
beginagain:
TOGGLE 7
PAUSE 200
GOTO beginagain

Does nothing. Some info:

Parallax Editor version 2.1
Basic Stamp 2 version 1.0

Thank you!
http://forums.parallax.com/images/smilies/burger.gif BJL

Robert Schwartz
02-22-2005, 10:13 AM
Not sure. Better coding would put that in a do...while loop and add an END:

' {$STAMP BS2}
' {$PBASIC 2.5}
OUTPUT 7
DO
TOGGLE 7
PAUSE 200
LOOP
END

BubbaJoeLouis
02-22-2005, 10:17 AM
May be better coding, but the issue remains the same :(

' {$STAMP BS2}
' {$PBASIC 2.5}
OUTPUT 7
DO
DEBUG CLS
TOGGLE 7
PAUSE 200
LOOP
END

is required to actually get a blink.

' {$STAMP BS2}
' {$PBASIC 2.5}
OUTPUT 7
DO
TOGGLE 7
PAUSE 200
LOOP
END

Does nothing. Also, it doesnt matter if I DEBUG CLS or DEBUG "Yo" it will work. But no debug, no service.

Chris Savage
02-22-2005, 10:21 AM
Would you be using a laptop? This problem has been known to happen on certain laptops, due to serial port issues. Putting the DEBUG statement in helps to keep the port open, I believe.



If you are using a laptop, this thread covered this as well...

http://forums.parallax.com./forums/default.aspx?f=5&m=55209

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--

Post Edited (Chris Savage) : 2/22/2005 2:26:21 AM GMT

BubbaJoeLouis
02-22-2005, 10:29 AM
Thats it! It actually started blinking as it should as soon as I pulled the com cable out. I have switched it to a desktop i have now it is acting normal.

Thanks for being my GOTO guy!
BJL

Chris Savage
02-22-2005, 10:31 AM
Don't mention it! Take care!



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
--==<{Chris}>==--