LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

simultaneously read analog in and pulse LED

Is there any way to simultaneously read analog in and pluse a LED. I have tried using the Digital Out to pulse the LED and Analog Read, but I only get approxmately 124Hz sample rate which is not fast enough for my application. I have also tried both the continuous and finite Analog In as well. The sample rate can be set much faster (1000Hz), but they won't let me pulse the LED properly. The LED does pulse but not at full intensity and the analog data is the inverse of what is expected. The data look like the analog in stops taking data when the LED is pulsed. Does this make sense to anyone? Any help would be appreciated.

0 Kudos
Message 1 of 3
(3,259 Views)

Hey OttoBerge,

You can't do continuous analog sampling at the same time as anything else in LIFA or you can get some weird behavior. This is documented in the context help for the continuous analog input VI's. You will have to make some changes to the framework if you want a sample rate of 1KHZ and pulse the LED at the same time.

Kevin Fort
Principal Software Engineer
NI
0 Kudos
Message 2 of 3
(2,561 Views)

By "pulse" do you mean you used the Tone function?  If so you could try setting the duration of Tone to 0 which will pulse until you send another Tone (duration 1ms) to end the pulse train.  While this is going on you can do finite sampling.  Continuous sampling always crashes my arduino.  Not sure if this is going to be fast enough for you and may just be the same thing you have.  These arduinos are not fast at ADC.  If you have to you could just have 2 arduinos as well (one continuous ADC, one pule train).

0 Kudos
Message 3 of 3
(2,561 Views)