Go Down

Topic: How do you adjust PWM periods for Servo control? (Read 394 times) previous topic - next topic

Echalon

I'm new to Arduino (ex-PIC programmer). (1) I'd like to know how Arduino users set their PWM period. The tutorials and videos I've seen thus far only deal with duty cycle modification. For servo control, typically 20ms is the required period. (2) Additionally, any suggestions on how to go about multiple control servo control with Arduino? I'm sure there are a couple of blokes with experience in this department. Thanks


ash901226

Usually people would use the servo library.
Since it is a class you can actually asign as many as you want under the limit of each bord capability.

Echalon


Usually people would use the servo library.


You're referring to the interrupt driven Servo library for Arduino using 16 bit timers? If I'm not mistaken the period is set at 20ms for the user by:

#define REFRESH_INTERVAL    20000     // minumim time to refresh servos in microseconds

Neat...

oric_dan

Yeah, the servo library takes care of everything. Besides answers on your other thread,
one thing not mentioned is the servo library for 328 chips can handle only 12 servos,
whereas the Mega2560 bds can handle 2X or 3X as many servos.

Go Up