Do...loop question?
Archiver
Posts: 46,084
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.
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
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]
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.
' {$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
>
>
>
>
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]
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
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