Skip to content

Commit 6d129e7

Browse files
committed
Move servo docs onto their own page
1 parent 1e3f865 commit 6d129e7

File tree

3 files changed

+36
-35
lines changed

3 files changed

+36
-35
lines changed

content/api/arduino.md

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -132,37 +132,3 @@ distance_metres = u.distance()
132132
If the ultrasound signal never returns, the sensor will timeout and
133133
return `None`.
134134
{{% /notice %}}
135-
136-
## Servos
137-
138-
{{% notice warning %}}
139-
Servos are only available on the [physical robot](/robots/physical/).
140-
{{% /notice %}}
141-
142-
You can control attached servo motors from the servo assembly. By default, servos will be unpowered when your robot starts, and can freely rotate when turned by hand. Upon setting a value, they will hold the corresponding position. They will become unpowered again when you turn off your robot, unplug your USB stick, or set their position to the special value `None`.
143-
144-
## Querying servos
145-
146-
The servo assembly can interface with up to sixteen servos connected to it.
147-
148-
```python
149-
servo_one = r.arduino.servos[1]
150-
```
151-
152-
{{% notice tip %}}
153-
Servo can be connected to any port, you don't have to start at 0!
154-
{{% /notice %}}
155-
156-
## Controlling servos
157-
158-
Servos can be controlled using the `position` parameter. This should be set to a value between -1 and 1.
159-
160-
```python
161-
servo_one.position = 0.65
162-
print(servo_one.position)
163-
>>> 0.65
164-
```
165-
166-
{{% notice tip %}}
167-
When `position` is set to `None`, the servo loses power and can freely rotate. This is the same state they're in at start-up.
168-
{{% /notice %}}

content/api/servos.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
title: Servos
3+
---
4+
5+
{{% notice note %}}
6+
Servos only apply to the [physical robot](/robots/physical/).
7+
{{% /notice %}}
8+
9+
You can control attached servo motors from the servo assembly. By default, servos will be unpowered when your robot starts, and can freely rotate when turned by hand. Upon setting a value, they will hold the corresponding position. They will become unpowered again when you turn off your robot, unplug your USB stick, or set their position to the special value `None`.
10+
11+
## Querying servos
12+
13+
The servo assembly can interface with up to sixteen servos connected to it.
14+
15+
```python
16+
servo_one = r.servo_board.servos[1]
17+
```
18+
19+
{{% notice tip %}}
20+
Servo can be connected to any port, you don't have to start at 0!
21+
{{% /notice %}}
22+
23+
## Controlling servos
24+
25+
Servos can be controlled using the `position` parameter. This should be set to a value between -1 and 1.
26+
27+
```python
28+
servo_one.position = 0.65
29+
print(servo_one.position)
30+
>>> 0.65
31+
```
32+
33+
{{% notice tip %}}
34+
When `position` is set to `None`, the servo loses power and can freely rotate. This is the same state they're in at start-up.
35+
{{% /notice %}}

content/robots/physical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The layout of the motors attached to the motor boards for the forklift robot are
1414

1515
## Servos
1616

17-
The front grabber is actuated by a single servo, attached to the [Arduino](/api/arduino/#servos). It is plugged in to port 0.
17+
The front grabber is actuated by a single [servo](/api/servos), attached to the [Arduino](/api/arduino/#servos). It is plugged in to port 0.
1818

1919
## Ultrasound
2020

0 commit comments

Comments
 (0)