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: 

Trying to use my computer LabView code to control 4 LED's

Solved!
Go to solution

Hello,

 

I'm a student working on a project at CU Boulder and I need a little bit of help. I'm kind of new to LabView but, I created a code that will create a random number, which turns on one of four LED's, and then, that LED will turn off after a slide bar (accelerometer) senses a value greater than 5 (this value will change after some accelerometer data). After this process, the random number generator will generate a new number for a new light. I'm just wondering how to tell the computer which LED icon indicates which real-life LED. Is there a way to hook up my LED's without changing my LabView code? Do I need to create a digital output DAQ assistant? Please see the attached labview code and hopefully you can help me out. We've had major problems trying to get our accelerometer to read a constant logical value and have just run into our LED problem.

 

Thanks, Zack

0 Kudos
Message 1 of 4
(3,526 Views)
Solution
Accepted by topic author zaal3595

Hi Zack,

 

your VI is kind of Rube-Goldberg award nominee... Smiley Wink

 

"how to tell the computer which LED icon indicates which real-life LED."

Well, you have to decide where to "hook" those "real-life" LEDs. When you have made your decision you'll need some hardware driver to switch the LEDs. A DAQ assistent may be a good choice when you use NI hardware. Otherwise use the driver coming with your hardware...

 

"Is there a way to hook up my LED's without changing my LabView code?"

No. "Real-life" LEDs need real hardware drivers...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(3,523 Views)

If you're going to simplify that VI, might as well remove duplicate code:

Making Lights Work simplified.png

0 Kudos
Message 3 of 4
(3,511 Views)

GerdW

 

Thank you for your help your code was a lot simplier than mine and has really helped me continue my project by making the necessary adjustments. I ended up using digital channels off a DAQ to control the voltage for the lights.

 

Zack

0 Kudos
Message 4 of 4
(3,476 Views)