Arduino PWM
Akshay from South Africa  [6 posts]
7 years
I am trying to set the PWM dutycycle on the Arduino UNO using the Sparkfun_Arduino module in RoboRealm. I need to set if between 0 - 255 the way analogWrite() on arduino works, but I cant do it. The servo(PWM) tab doesn't allow me to set such high dutycycles.

I wan the Arduino UNO to work like the Sparkfun_SerIO module.

Can you please help me.
Anonymous 7 years

The servo signals generated by the Arduino are between 500 and 2500 in order to get the timing right on most standard servos. If you are asking about converting from 0-255 to 500-2500 BEFORE you send the value to the Arduino then use the Scale_Variable module to convert the variable to the 500-2500 range and use it in the Arduino module.

Alternatively you could modify the Arduino code which we provide the source to ... but that's not recommended unless you are familiar with programming the Arduino.

Note that the SerIO converts from 0-255 in the Arduino ... that's code that Sparkfun provides so we didn't want to change that. Note that at 0-255 you get less precision than 500-2500 .. which may or may not be an issue for you.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index