To control the servo from CircuitPython we'll use its built in PWM, or pulse-width modulation, signal generation capabilities. Be sure to read the CircuitPython analog I/O guide for more details on PWM signals!
Before you get started it will help to read these guide pages for more background information on servo motors too:
Be sure your hardware is wired up as shown on the previous page, and your servo power supply is turned on (you might notice the servos jerk or move slightly when the power is turned on--that's normal!).
There's two ways to control servos, one is lower-level - where you will control the PWM pin directly. And one is higher-level using the Motor Library
For typical non-continuous servo motors, control is best done with the high level
adafruit_motor library. The
servo module provides an excellent interface and is easy to understand.
Low level control involves working with the Pulse Width Modulation (PWM) directly which is rarely required.
The following pages discuss high and low level control of servos in CircuitPython.