10-27-2012 05:09 AM
Hi all,
I wanted to create a pwm signal from my arduino mega 2560 to my DC brushless by using the attached code but something goes wrong, I kept getting error message from labview.
Please help me if anyone knows the solution.
Thank you!
Regards,
Loo
10-27-2012 11:40 AM
I claim you need two "digital write" sub vis in your block diagram. One "digtal write" to write the pin direction information. A second "digital write" to wtrite the PWM siganl to the pin . Try this modification and let us know if it works.
hrh1818
10-27-2012 02:08 PM
What error messages are you getting? What are you using for a motor controller?
Tip: Never use the "Set Digital Pin Mode.vi" inside of a repeating loop (unless you are changing the mode mid-execution), it will just slow down the Arduino. Put it outside of the loop after "Init.vi".
10-27-2012 03:45 PM
My comment about needing two digital write sub VIs is bad advice. I need a lot more time to come up with a better solution Most llkely others will beat me to a solution.
hrh1818
10-27-2012 04:24 PM
Attached is a version of your PWM that works. Two comments:
One. In this version Run the VI, Enter a PWM value and then click on Send. Repeat the Enter a PWM value and Send sequence as manry times as required. Click on Stop to quit.
Two. This version was modifeid to work with COM port 3 on my computer. You may need to change the COM port to work with your computer.
hrh1818
10-28-2012 10:26 PM
thanks guys for your suggestions.
I am using ESP for the speed control
everything is ok when I put "Set digital pin mode" outside the loop!
Cheers,
Loo