increasing number of servos servo.h can handle

I didn’t see any posts about this, please forgive me if I missed something. I was curious why the servo.h library is limited to 2 servos on pins 9 and 10. The description page states:

This library uses functionality built-in the hardware on pins 9 and 10 of the microcontroller to control the servos without interfering with other code running on the Arduino.

I’m curious what the built-in hardware that allows this functionality. I know pins 9 10 and are capable of PWM output (which is not appropriate for running servers directly) but so do 3, 5, 6, and 11. Could servo.h be modified as such, around line 35:

static uint8_t attached3;
static uint8_t attached5;
static uint8_t attached6;
static uint8_t attached11;

Giving control of 6 servos?


It could be done but the timers on the other pins are used for other things. Use the other servo library, it works great and addresses servos on any pins.

The only inconvenient issue about the other library is that it is named the same thing as the first one. And both should be in the core distribution. There was a rough consensus to change the name of the second library to SoftwareServo - following the SoftwareSerial example, only no one has done anything about it in more than a few months.