ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Light multiple leds

Hello,

 

I am trying to write a VI where a dial controls how many leds are lit up at a time. For example if dial is set to 2 then 2 leds are lit up. I have attached my VI as it sits now. I am unsure how to go about this anymore since i couldnt get the case structure to work, unless i just don't know what I'm missing or need.

 

Thanks!

0 Kudos
Message 1 of 6
(3,735 Views)

Nevermind figured it out. Smiley Tongue

0 Kudos
Message 2 of 6
(3,723 Views)

@steggets wrote:

I have attached my VI as it sits now.


No, you only attached a picture. Please attach the actual VI.

 

Since you cannot light a fractional number of LEDs, the control should probably be an interger. I would also use an array of LEDs, much simpler! You also need to slow down your loop. Currently it spins millions of times per second. You also don't need a case structure.

 

Try it!

0 Kudos
Message 3 of 6
(3,716 Views)
Don't know how to use arrays otherwise I would!
0 Kudos
Message 4 of 6
(3,709 Views)

@steggets wrote:
Don't know how to use arrays otherwise I would!

Do you want to learn how to use arrays?  Try them, you'll like them. 🙂

 

Example_VI_BD.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 6
(3,658 Views)

Or convert the numeric control value directly to an array indicator:

 

Slide value to boolean array.png

 

Slide value to boolean array - front panel.png

Message 6 of 6
(3,641 Views)