How is servo library managing 6 servos on arduino uno?

If i want to use servos without library i can do it trough Timer1 on arduino uno (Atmega 328P), by setting it to CTC Mode but this timer is only connected to pins 10 and 9 on the board or are they not? How are they making every ~pin work with servos, are they using some external 16-bit timers on the uno board?

The Arduino Servo library is flexible enough to work with various pins on the Arduino Uno. While Timer1 is commonly used, the library can be configured to use other available timers as well. On the ATmega328P, Timer0 and Timer2 are also 8-bit timers that can be used for generating PWM signals and controlling servos. These timers are associated with different pins, allowing for a broader range of options.

1 Like

Thanks for the reply, i will look into interupts.

The servo library allows Arduino boards to control a variety of servo motors.
This library can control a great number of servos. It makes careful use of timers: the library can control 12 servos using only 1 timer.

This is from the documentation at :-
Servo libraries

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.