LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Need help with Blinky

I created a program naned SepSignalBit that does the same thing as Blinky.  Blinky is a program that comes with Arduino and is the "Hello World" proigram for microcontrollers.   A copy of StepSignalBit is attached.

The VI wiil run but a LED connected toa digital pin doesnot flash.  The TX and RX LEDS on theArdunio board flash when the program is running. indicating packets are being sent to the Arduio board.

To run the program connect a LED in series with a 220 ohm resistor to any digital pin,  Then on the front panel set "Pin Number" to the same pin number as the LED is connected to and the "# of Steps" to a low value like10.  Next on the "Set Digital Pin Mode" sub vi set "Pin Mode" to "output". Finally click on the Labview "Run" button.

What needs to be done to fix this VI to get a LED to flash?

Howard

0 Kudos
Message 1 of 5
(3,708 Views)

Problem Solved.    Found out I couldn't depened upon using a sub VI to set a digital pin to output.  When I connected the numeric constant 1 to the mode input of the "Set Pin Mode" sub VI the StepSignalBit.VI.VI worked as expected.

I wish I could post a corrected version of the VI.  But I don't see any method for adding an attachment when replying to a message.

Howard

0 Kudos
Message 2 of 5
(2,963 Views)

hrh1818,

As you mentioned you must use a Set Pin Mode vi before you can 'write' to a digital pin.  This is because they pin mode defaults to input, so you could read from a digital pin without using the Set Pin Mode vi, but it is usually best to explicitly set the pin mode before reading or writing.

Check this out for more info.

http://arduino.cc/en/Tutorial/DigitalPins

-Sam

0 Kudos
Message 3 of 5
(2,963 Views)

Thank you for your reply.

The problem I had was cause by the fact it was not clear whether one should set a digital pin I/Os direction on the front panel of the "Set Digital Pin Mode" sub VI, or with a numeric constant on the main block diagram or with a numeric control on the main front panel.  It appears the behavior of the"Set Digital Pin Mode" VI is inconsistent with the behavior of the "INIT LIFA" VI.  

Hence how do you know when you should set the configuration data for a sub VI on its front panel or when you need to add the configuration data for a Sub VI to the main front panel or to the main block diagram of the VI?

Howard

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

Howard,

Again all of this is just basic LabVIEW Programming.  Take some time to go through some basic example, tutorials, and getting started documents and this should all be explained.  If you have general LabVIEW questions I would post them on the main forums on ni.com.

See also:

http://www.ni.com/academic/students/learnlabview/

http://www.ni.com/gettingstarted/labviewbasics/

This one specifically discusses dataflow which is what you are asking about.

http://www.ni.com/gettingstarted/labviewbasics/dataflow.htm

-Sam K

LIFA Developer

0 Kudos
Message 5 of 5
(2,963 Views)