Showing results for 
Search instead for 
Did you mean: 

controlling a pulsing LED

Go to solution


What would be the simplest way to turn an LED on and off at a rate that is controlled by a knob or something. Meaning that I could either leave it turned off or make it pulse every three seconds, five seconds, etc. ?

0 Kudos
Message 1 of 11

Forgot to mention that this is an LED in the front panel not actual hardware.

0 Kudos
Message 2 of 11

Write a True, wait, Write a False, wait, repeat. The knob would be wired to the wait. Add a comparison of the knob value and skip the write True if the values is less than some value. Do not do an equal comparison unless the knob is an integer data type.


If this is an actual LED, you would be using a DAQmx Write. If not, you can use a local variable of the indicator but you will get bonus points if you don't and instead use a state machine.

0 Kudos
Message 3 of 11

The attached VI will cause the LED to blink at the rate set by the knob in seconds.  If set to 0, the LED will be off and will not blink.


- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 11

That vi won't open for me since I'm using 9.0

0 Kudos
Message 5 of 11


Would it be possible to get a screenshot of that VI since I cannot open it with this version?

0 Kudos
Message 6 of 11
Accepted by nano_era



I have attached the vi in version 9.0.


- tbob

Inventor of the WORM Global
Message 7 of 11

The vi you made was able to accomplish what I wanted to do. Thank you.

Now I tried to make 2 controllable LEDs in the same loop by just copying the same code for another LED and CONTROL. What that does is they both share the same timing no matter what I set them both to. Any help on how to do the same exact thing you showed me before but with 2 LEDS in the same loop would be appreciated. I was thinking it had something to do with the wait function or the shift registers? Should I make another loop altogether?

0 Kudos
Message 8 of 11

If both LEDs will come on and off together, just create another LED and wire it in parallel to the existing one.  If the LEDs are to be separated (one could be on while the other could be off), create another shift register and duplicate the code.  As long as the timing is the same, you can use just one loop for both LEDs.  Instead of me wiring it for you, try it yourself.  That is the only way you will learn.


- tbob

Inventor of the WORM Global
0 Kudos
Message 9 of 11

Thanks for the reply, just asking for ideas.

As to the timing, I want them in the same loop in order to poll for the control value at the same time but not necessarily for the lights to turn on at the same time or for them to share the same pulse time. That would be completely up to the user.

I will continue to work on it. I appreciate your replies.

0 Kudos
Message 10 of 11