Blinking Led, beginners question
Archiver
Posts: 46,084
Peter-
If you literally mean you want an LED to blink (or not) while other
things are going on, use a blinking LED. They're commonly available
and allow your program to take care of other business.
Regards,
Steve
On 24 Jul 01 at 20:06, daliti wrote:
> If I want to blink a led slowly, then i have to insert anyway a long
> Pause time (i think). This also means that the program stops on that
> moment. How can I prevent the program stops - say I want to measure
> a high frequency pulse while "led-blinking" - and the led needs to
> keep blinking? Thanks for your help.
If you literally mean you want an LED to blink (or not) while other
things are going on, use a blinking LED. They're commonly available
and allow your program to take care of other business.
Regards,
Steve
On 24 Jul 01 at 20:06, daliti wrote:
> If I want to blink a led slowly, then i have to insert anyway a long
> Pause time (i think). This also means that the program stops on that
> moment. How can I prevent the program stops - say I want to measure
> a high frequency pulse while "led-blinking" - and the led needs to
> keep blinking? Thanks for your help.
Comments
Pause time (i think). This also means that the program stops on that
moment. How can I prevent the program stops - say I want to measure a
high frequency pulse while "led-blinking" - and the led needs to keep
blinking?
Thanks for your help.
the puase time, there is no possibility to do anything else then
waiting till the pause time is counted down.
Thanks
Tim, Belgium.
one of the stampsinclass documents.
On Tue, 24 Jul 2001, daliti wrote:
> If I want to blink a led slowly, then i have to insert anyway a long
> Pause time (i think). This also means that the program stops on that
> moment. How can I prevent the program stops - say I want to measure a
> high frequency pulse while "led-blinking" - and the led needs to keep
> blinking?
> Thanks for your help.
>
>
> 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/
>
>
>
Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
email: lamont@a... WWW: http://www.serv.net
"...There's no moral, it's just a lot of stuff that happens". - H. Simpson
>If I want to blink a led slowly, then i have to insert anyway a long
>Pause time (i think). This also means that the program stops on that
>moment. How can I prevent the program stops - say I want to measure a
>high frequency pulse while "led-blinking" - and the led needs to keep
>blinking?
Arrange your program steps something like this:
Turn on LED
Measure high frequency pulse
do other stuff if you want to
pause (LED on time)
turn LED off
do more stuff
pause (LED off time)
go back to top of program
The Stamp can do an incredible number of things during the LED on and LED
off times. The whole on or off time doesn't have to be a useless pause.
Jim H
peter.christiaen@s... writes:
> If I want to blink a led slowly, then i have to insert anyway a long
> Pause time (i think). This also means that the program stops on that
> moment. How can I prevent the program stops - say I want to measure a
> high frequency pulse while "led-blinking" - and the led needs to keep
>
This is a little advanced, but can be done. What you need to do is create a
timer variable in your main program loop. At the end of the main loop (after
you've done your frequency measurement), you increment your timer then take
the modulus of some value (the larger this value, the slower your LED will
blink). If the result is zero, toggle the LED. Like this:
MyLED CON 0
MaxTimer CON 500
timer VAR Word
Init:
LOW MyLED
Main:
' do frequency measurement here
timer = timer + 1 // MaxTimer
IF (timer > 0) THEN Main
TOGGLE MyLED
GOTO Main
When this program runs it will take 500 frequency measurements before
toggling the LED. As your program grows, the LED blink timing will change so
you'll need to adjust the value of MaxTimer accordingly.
-- Jon Williams
-- Applications Engineer, Parallax
[noparse][[/noparse]Non-text portions of this message have been removed]
You might blink the led, and sense for the high frequency pulse
within a "loop" that you would do for "x" number of times, each
with a very short pause time. The net effect would be that you
would be blinking and sampling immediately following each blink.
An "If/then" within the loop could then take the program elsewhere
if a particular condition was reached.
Russ
Original Message
From: daliti <peter.christiaen@s...>
To: <basicstamps@yahoogroups.com>
Sent: Tuesday, July 24, 2001 4:10 PM
Subject: [noparse][[/noparse]basicstamps] Blinking Led, beginners question
| Just completing my question: I suppose while the programs stops in
| the puase time, there is no possibility to do anything else then
| waiting till the pause time is counted down.
| Thanks
| Tim, Belgium.
|
|
| 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/
|
|
program loop is executed.
Original Message
> Just completing my question: I suppose while the programs stops in
> the puase time, there is no possibility to do anything else then
> waiting till the pause time is counted down.
calculate the timing of everything that you do inside the loop to get an
accurate blink interval ; the 555 timer will do this for you in a separate
IC.
On Tue, 24 Jul 2001, Rodent wrote:
> Why not just toggle the pin, so the light goes on and off each time the
> program loop is executed.
>
>
Original Message
>
>
> > Just completing my question: I suppose while the programs stops in
> > the puase time, there is no possibility to do anything else then
> > waiting till the pause time is counted down.
>
>
>
>
>
> 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/
>
>
>
Sean T. Lamont, CTO / Chief NetNerd, Abstract Software, Inc. (ServNet)
Seattle - Bellingham - Vancouver - Portland - Everett - Tacoma - Bremerton
email: lamont@a... WWW: http://www.serv.net
"...There's no moral, it's just a lot of stuff that happens". - H. Simpson