LabVIEW Interface for Arduino Discussions

cancel
Showing results for 
Search instead for 
Did you mean: 

Slow digital write to Arduino (PWM)

Hello Everyone,

I have the following VI. I am using nested loops. One to generate waveform and the second one to iterate through the array of obtained waveform samples and generate my owm PWM on the arduino.

Everything works with one problem. As you can see from the VI I am writing digital values to the arduino inside the second loop and it turns out to be slow. Like even if I set loop delay to 0 the write to arduino slows down everything. This is the first time I am using the toolkit and would like to know if there are ways of speeding up the write procedure to arduino.

Appreciate any input/help with this.

DR

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

Serial communication is relatively extremely slow!  The only method that I would suggest to do PWM is to use the native PWM function on the Arduino.

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

I came to the same conclusion after disconnecting the generated PWM from the digital input of the arduino interface and using a constant integer instead. This also slowed down the loop execution a lot. Only when the write to serial function is not present the loops runs fine.

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