08-24-2012 10:10 AM
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
08-24-2012 06:19 PM
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.
08-24-2012 09:10 PM
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.