Skip to main content
Servos are a bit like motors, except their position is fixed. This is useful for building an arm mechanism that grabs cubes, or anything else that has fixed states that it needs to be in. Similarly to motors, the position of a servo is expressed as a percentage. This can be negative. Servos are plugged into the PWM ports on the BrainBox. PWM 0 represents servo 0, PWM 1 is servo 1, etc.

Python

You can control servos using the servos property of the Robot object. To set the first servo to the 50% position use:
To control the fourth servo instead, replace servos[1] with servos[3]. Here’s a more complete example: