Setting up Servos on Separate Timers

I am using the Arduino Mega to control 4 brushless motors using the built in Servo library with the Arduino IDE. I changed REFRESH_INTERVAL to 8000 to increase the frequency to 125Hz for better performance.

I want to add more standard Servos to the control board but do not want to sacrifice the refresh rate from the first four. Is there a way to assign one group of servos to one timer and then set the other group of servos to a separate one?

Easy way, create 8 more Servo objects (directly after creating the BLDC Servo objects) but don't attach them. Every timer can hold 12 servo's so that will fill the first timer. Servo object 12 to 23 will go on to the next timer. And because Servo objects 4 to 11 are not attached they are skipped. Just leaving the first 4 for the BLDC motor.

Easy way, create 8 more Servo objects (directly after creating the BLDC Servo objects) but don't attach them. Every timer can hold 12 servo's so that will fill the first timer. Servo object 12 to 23 will go on to the next timer. And because Servo objects 4 to 11 are not attached they are skipped. Just leaving the first 4 for the BLDC motor.

Never thought to do it this way, that's very easy! Thank you!

You're welcome :slight_smile: