Pages: [1]   Go Down
Author Topic: How do you adjust PWM periods for Servo control?  (Read 320 times)
0 Members and 1 Guest are viewing this topic.
Port Elizabeth
Offline Offline
Newbie
*
Karma: 0
Posts: 7
A moment's insight can be worth a life's experiences...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Malaysia
Offline Offline
Sr. Member
****
Karma: 7
Posts: 393
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Port Elizabeth
Offline Offline
Newbie
*
Karma: 0
Posts: 7
A moment's insight can be worth a life's experiences...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

the land of sun+snow
Offline Offline
Faraday Member
**
Karma: 149
Posts: 2790
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: