Shop OBEX P1 Docs P2 Docs Learn Events
Easy goto question! — Parallax Forums

Easy goto question!

BubbaJoeLouisBubbaJoeLouis Posts: 3
edited 2005-02-22 02:31 in BASIC Stamp
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!
burger.gif BJL

Comments

  • Robert SchwartzRobert Schwartz Posts: 141
    edited 2005-02-22 02:13
    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
  • BubbaJoeLouisBubbaJoeLouis Posts: 3
    edited 2005-02-22 02:17
    May be better coding, but the issue remains the same [noparse]:([/noparse]

    ' {$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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-02-22 02:21
    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
  • BubbaJoeLouisBubbaJoeLouis Posts: 3
    edited 2005-02-22 02:29
    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 SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-02-22 02:31
    Don't mention it!· Take care!



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    --==<{Chris}>==--
Sign In or Register to comment.