Shop OBEX P1 Docs P2 Docs Learn Events
Do...loop question? — Parallax Forums

Do...loop question?

ArchiverArchiver Posts: 46,084
edited 2004-05-10 20:34 in General Discussion
I just got the Basic Stamp 2p40 with the demo board and am just
starting to learn it...whenever i enter

'{$STAMP BS2p}

DO

HIGH 5
PAUSE 500
LOW 5
PAUSE 500

LOOP

The LED will run through the cycle once, turning on and then turning
off, but will not loop or repeat like it should. I can get the
desired effect by running

MAIN:
HIGH 5
PAUSE 500
LOW 5
PAUSE 500
GOTO MAIN

This works fine, so I am wondering why the DO...LOOP command is not
working. any ideas...it appears as if the led is twitching like it
wants to start over but isn't.

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-05-09 19:33
    In a message dated 5/9/2004 6:29:51 PM Eastern Daylight Time,
    markmcleod50@y... writes:


    > I just got the Basic Stamp 2p40 with the demo board and am just
    > starting to learn it...whenever i enter
    >
    > '{$STAMP BS2p}
    >

    Did you call up the PBasic 2.5 directive?

    Sid Weaver
    New item - New prices.........
    http://www.visualmuses.com/chipcircuit/index.html





    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-09 23:38
    Hi Mark,

    Your Stamp does not know you want to run PBASIC 2.5

    Just ad the line

    '{$PBASIC 2.5}

    to your code after '{$STAMP BS2p} and your problem will (hopefully)
    disapear.

    Regards,

    Klaus

    --- In basicstamps@yahoogroups.com, "sponsitility"
    <markmcleod50@y...> wrote:
    > I just got the Basic Stamp 2p40 with the demo board and am just
    > starting to learn it...whenever i enter
    >
    > '{$STAMP BS2p}
    >
    > DO
    >
    > HIGH 5
    > PAUSE 500
    > LOW 5
    > PAUSE 500
    >
    > LOOP
    >
    > The LED will run through the cycle once, turning on and then
    turning
    > off, but will not loop or repeat like it should. I can get the
    > desired effect by running
    >
    > MAIN:
    > HIGH 5
    > PAUSE 500
    > LOW 5
    > PAUSE 500
    > GOTO MAIN
    >
    > This works fine, so I am wondering why the DO...LOOP command is not
    > working. any ideas...it appears as if the led is twitching like it
    > wants to start over but isn't.
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-10 00:11
    You also need this directive...

    ' {$PBASIC 2.5}


    >I just got the Basic Stamp 2p40 with the demo board and am just
    >starting to learn it...whenever i enter
    >
    >'{$STAMP BS2p}
    >
    >DO
    >
    > HIGH 5
    > PAUSE 500
    > LOW 5
    > PAUSE 500
    >
    >LOOP
    >
    >The LED will run through the cycle once, turning on and then turning
    >off, but will not loop or repeat like it should. I can get the
    >desired effect by running
    >
    >MAIN:
    > HIGH 5
    > PAUSE 500
    > LOW 5
    > PAUSE 500
    >GOTO MAIN
    >
    >This works fine, so I am wondering why the DO...LOOP command is not
    >working. any ideas...it appears as if the led is twitching like it
    >wants to start over but isn't.
    >
    >
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the
    >Subject and Body of the message will be ignored.
    >
    >Yahoo! Groups Links
    >
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-10 16:14
    In a message dated 5/10/2004 3:11:13 PM Eastern Daylight Time,
    commentsoneverything@y... writes:


    > I believe the problem may be that the editor I am using is version
    > 2.1 rather than 2.5. How do I download the 2.5 version?
    >

    Simple - go to the Parallax site and download the latest version.


    Sid Weaver
    New item - New prices.........
    http://www.visualmuses.com/chipcircuit/index.html





    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-10 18:17
    I'm having the same problem including the "Twitching."

    I do have the the ' ($PBASIC 2.5) comment inserted but the "DO LOOP"
    command is not listed.

    I am using the BOE and a BS2 rather than a BS2p.

    I believe the problem may be that the editor I am using is version
    2.1 rather than 2.5. How do I download the 2.5 version?

    Thanks
  • ArchiverArchiver Posts: 46,084
    edited 2004-05-10 20:34
    The editor version is 2.1 -- the language syntax is called 2.5. If you
    are using the 2.1 editor you can use DO-LOOP in your programs. The
    problem you're having may be related to your serial port -- we've seen
    this before. If you insert a DEBUG line in your program, I'll be the
    problem goes away (I won't explain here, you can search the list as it
    has been covered many times).

    Put this before your DO-LOOP section

    DEBUG "DO-LOOP Demonstration"

    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: commentsoneverything [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=0LqowR7vasJx3dhKxjEIvNJYoiXFMouhUj1IRVs5ZpdQaKMxxFWzguoiEWzFbpNN4Ki45gsrWqrxP1pUg54TP5UsmkdX]commentsoneverything@y...[/url
    Sent: Monday, May 10, 2004 12:18 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Re: DO...LOOP QUESTION?


    I'm having the same problem including the "Twitching."

    I do have the the ' ($PBASIC 2.5) comment inserted but the "DO LOOP"
    command is not listed.

    I am using the BOE and a BS2 rather than a BS2p.

    I believe the problem may be that the editor I am using is version
    2.1 rather than 2.5. How do I download the 2.5 version?

    Thanks
Sign In or Register to comment.