> ## Documentation Index
> Fetch the complete documentation index at: https://docs.roboconoxon.org.uk/llms.txt
> Use this file to discover all available pages before exploring further.

# Servos

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:

```python theme={null}
r.servos[1] = 50
```

To control the fourth servo instead, replace `servos[1]` with `servos[3]`.

Here's a more complete example:

```python theme={null}
import robot

r = robot.Robot()

# set servo 1 to the 50% position
r.servos[1] = 50

# set servo 3 to the -100% position
r.servos[3] = -100

# set servos 1 & 3 to the default positions
r.servos[1] = 0
r.servos[3] = 0
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.