04-03-2015 06:42 PM - edited 04-03-2015 06:46 PM
Hey,
I've slowly been learning LV but I'm stumped on how to change the blinking rates for LED's.
I know that you can change the global blinking rate but I would like to apply different rates for individual LED's (which can be switched on/off) independent of one another.
For example:
If turned on, LED 1 will be on for 3 seconds, then off for 2 seconds, on for 3 seconds, off for 2, etc, (until I choose to stop this specific LED).
Simultaniously, if turned on, LED 2 will be on for 4 seconds, then off for 4 seconds, etc., (until I choose to this specific LED).
Any help would be greatly appreciated, thanks in advance.
04-03-2015 11:41 PM
04-04-2015 06:20 AM
Oh okay, well I simply wanted to make two different LED's flash at different rates, and whilst the global blink rate can change the frequency of the flash I was looking at making one LED flash with say 10 seconds off and then 5 seconds off, whilst the other be something like 5 seconds and 6 seconds off. Though the specific on/off times are irrelevant really.
And it's because I've started getting in to LabView and would like to get to know the basics, and was stumped by this when there wasn't an easy way to do it as it seems to be a fairly simple function to have.
04-04-2015 08:05 AM
04-04-2015 08:31 AM
What you're trying to do isn't very complicated.
You'll want to start off easier by using the same on and off time. Make two loops with different wait (ms) times wired. Start off making things easier on yourself. Choose blink times of 500 and 1000. Use a shift register to wire into the LEDs with a NOT wired from the input. This will flip the value in each iteration and blink the LEDS at the ms rate provided. Do a quick search to figure out how to stop two different loops using the same control.
Once you understand how that works, you can put together logic that will blink on and off for different times. One thing to be careful with: you don't want to wait the full time you were mentioning before. Even if it's 6s on and 6s off, that's a LONG time to use a wait (ms). Your program won't respond to you during that time. You'd want to do something like a 100ms wait and run the quotient/remainder from the iteration terminal. If you divide by 60 and the remainder is 0, NOT the shift register. Otherwise, pass it through. That way, you'll maintain responsiveness but still flash at the much slower rate.