Servo: multiple servos

Control multiple servos at once

Since many PWM peripherals have multiple channels (usually 2 or 4) we can in fact control multiple servos using a single PWM peripheral (freeing up other PWM peripherals for other tasks). This is why it’s called servo.NewArray!

The code is very similar to using a single servo, but this time we control more than one from different goroutines. If you need more servos, you can of course use more than one servo array with different PWM peripherals.

Last modified May 1, 2025: Add PWM tour (af9cc3a)
Loading...

Note: these numbers are estimates, based on datasheets and measurements. They don't include everything and may be wrong.

Loading...