LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create an if statement and use LED?

I'm new to using labview and I'm having a hard time understanding how to use the LIFA platform. I want to recreate a simple if statement and use that to control some indicator LEDs (If case 1 happens, LED1 turns on, if case 2 happens, LED2 turns on, ect case3,case4...). I know how to do it in arduino using if statements and digital writes and delays but on LIFA it's quite confusing. I see that I can use a case sequence as an if statement but then how would I use indicator LEDs? The digital write block doesn't have any part that can directly attach to an indicator LED since the LED is boolean. Also, I'm trying to have the LED on the front panel and attached physically to one of the digital pins on the arduino. Could someone give me some insight as to how this is done? Thanks.

0 Kudos
Message 1 of 5
(5,332 Views)

The best way to do it really depends on what your end goal is and how your system is going to be designed.

If you are asking about front panel LEDs, you simply need to wire the appropriate value to it (true or false).  For real LEDs, you need to write either a 1 or a 0 with the digital write VI.

But, like I said, the more information you can provide, the better advice you will get.

0 Kudos
Message 2 of 5
(4,596 Views)

I want to be able to take a reading from a sensor, say a photocell, and for a case say a reading less than 50, turn on LED on digital pin 2. And then for the case, greater than 50, turn on just LED on digital pin 3. And everything would display on the front panel as well. I have the VI attached, but I just don't know how to proceed further from what I have done so far. It's a trivial thing to do on the Arduino IDE but labview is quite confusing for me.

0 Kudos
Message 3 of 5
(4,596 Views)

Here is what I think you are wanting:

0 Kudos
Message 4 of 5
(4,596 Views)

arduino code please

0 Kudos
Message 5 of 5
(3,780 Views)