Shop OBEX P1 Docs P2 Docs Learn Events
Time — Parallax Forums

Time

ArchiverArchiver Posts: 46,084
edited 2003-08-07 04:05 in General Discussion
Can Someone help me to on this.

I Want to turn a LED on for 5 min and off for 10 Min
What is the code using FORNEXT?

Or any another way for that big time

Thank you

Edson

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-08-07 02:22
    In a message dated 8/6/2003 6:04:26 PM Pacific Daylight Time,
    h40miami@y... writes:

    > Can Someone help me to on this.
    >
    > I Want to turn a LED on for 5 min and off for 10 Min
    > What is the code using FORNEXT?
    >
    > Or any another way for that big time
    >
    > Thank you
    >
    > Edson

    In a message dated 8/6/2003 3:57:55 PM Pacific Daylight Time,
    h40miami@y... writes:

    > Thank you for your Help.
    >
    > Could you give a code Exemplo for 7 Min?
    >
    > Thank you
    >
    >
    > --- Jon Williams <jwilliams@p...> wrote:
    > >This is fairly simple. Pick a *base* delay (1
    > >second, for example), then
    > >run it in a loop.· Here's a quick subroutine that
    > >will work for you.
    > >
    > >Pause_1Sec:
    > >· FOR timer = 1 TO seconds
    > >·· PAUSE 1000
    > >· NEXT
    > >· RETURN
    > >
    > >If you declare seconds as a Word variable, you can
    > >have delay of up to
    > >18 hours, 12 minutes, 15 seconds.
    > >
    > >-- Jon Williams
    > >-- Parallax
    >
    I don't remember how to declare variables but.....

    For 5 minutes set seconds to 300
    For 10 minutes set seconds to 600

    seconds var word
    seconds = 300·· (I think....if this is wrong, other stampers will chime
    in....)


    Pause_1Sec:
    FOR timer = 1 TO seconds
    PAUSE 1000
    NEXT
    RETURN

    This will consume a little more than 7 minutes because the "NEXT" and "FOR
    timer = 1 TO seconds" do consume a small amount of time.



    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-07 02:24
    Well, the Stamp isn't very time accurate over long periods, but it
    should be pretty close to say something like:

    Top:
    HIGH LED
    FOR i=1 to 5
    PAUSE 60000 ' 60000 = 1 minute
    NEXT
    LOW LED
    FOR i= 1 to 10
    PAUSE 60000
    NEXT
    GOTO Top

    You need to define i (a nib or byte) and LED. If your LED lights when
    low, reverse the HIGH and the LOW. You could get fancy:

    Top:
    HIGH LED
    Minutes=5
    Gosub PauseMin
    ...

    I'll let you work that one out yourself.

    Hope that helps!

    Al Williams
    AWC
    * NEW Kits:
    http://www.al-williams.com/kits.htm




    >
    Original Message
    > From: h40miami [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=WGCT68couOvl8k311OmoPB57GBUh5QJSoutpdcDnYcOKQi4EzwUXqdqjQJzmTEYJ4k5ZyiZr6QWefQ]h40miami@y...[/url
    > Sent: Wednesday, August 06, 2003 8:03 PM
    > To: basicstamps@yahoogroups.com
    > Subject: [noparse][[/noparse]basicstamps] Time
    >
    >
    > Can Someone help me to on this.
    >
    > I Want to turn a LED on for 5 min and off for 10 Min
    > What is the code using FORNEXT?
    >
    > Or any another way for that big time
    >
    > Thank you
    >
    > Edson
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-08-07 04:05
    Hi......

    Thank you for your help..

    It help me alot.



    --- Al Williams <alw@a...> wrote:
    > Well, the Stamp isn't very time accurate over long
    > periods, but it
    > should be pretty close to say something like:
    >
    > Top:
    > HIGH LED
    > FOR i=1 to 5
    > PAUSE 60000 ' 60000 = 1 minute
    > NEXT
    > LOW LED
    > FOR i= 1 to 10
    > PAUSE 60000
    > NEXT
    > GOTO Top
    >
    > You need to define i (a nib or byte) and LED. If
    > your LED lights when
    > low, reverse the HIGH and the LOW. You could get
    > fancy:
    >
    > Top:
    > HIGH LED
    > Minutes=5
    > Gosub PauseMin
    > ...
    >
    > I'll let you work that one out yourself.
    >
    > Hope that helps!
    >
    > Al Williams
    > AWC
    > * NEW Kits:
    > http://www.al-williams.com/kits.htm
    >
    >
    >
    >
    > >
    Original Message
    > > From: h40miami [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=HJS5Jva626-AC6sSnkUPwqwupamoHYJxGGii3kSB4MC6nozvveFOygYuVbGHZ8bjIemg6IsFpWVaYYs]h40miami@y...[/url
    > > Sent: Wednesday, August 06, 2003 8:03 PM
    > > To: basicstamps@yahoogroups.com
    > > Subject: [noparse][[/noparse]basicstamps] Time
    > >
    > >
    > > Can Someone help me to on this.
    > >
    > > I Want to turn a LED on for 5 min and off for 10
    > Min
    > > What is the code using FORNEXT?
    > >
    > > Or any another way for that big time
    > >
    > > Thank you
    > >
    > > Edson
    > >
    > >
    > > 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.
    > >
    > >
    > > Your use of Yahoo! Groups is subject to
    > > http://docs.yahoo.com/info/terms/
    > >
    > >
    > >
    >
    >
    > 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.
    >
    >
    > Your use of Yahoo! Groups is subject to
    > http://docs.yahoo.com/info/terms/
    >
    >


    __________________________________
    Do you Yahoo!?
    Yahoo! SiteBuilder - Free, easy-to-use web site design software
    http://sitebuilder.yahoo.com
Sign In or Register to comment.