Skip to content

Commit 00a63a1

Browse files
authored
Merge pull request #183 from sourcebots/ultrasound-pins
Explain analogue pins
2 parents a254c02 + 688b6ef commit 00a63a1

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

content/api/ultrasound.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Ultrasound sensors have a maximum range of 2 metres, if objects are further than
2121

2222
``` python
2323
# Get the closest distance to the ultrasound sensor is reading.
24-
distance_metres = r.arduino.pins[pin].analogue_value
24+
distance_metres = r.arduino.pins[AnaloguePin.A0].analogue_value
2525
```
2626

2727
### Physical

content/robots/crane.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ The layout of the [encoders](/api/encoder) are as follows:
2929

3030
## Ultrasound sensor
3131

32-
The crane has one [ultrasound sensor](/api/ultrasound) pointing downwards from the magnet. The ultrasound sensor is attached to Arduino pin 0.
32+
The crane has one [ultrasound sensor](/api/ultrasound) pointing downwards from the magnet. The ultrasound sensor is attached to Arduino pin `AnaloguePin.A0`.
3333

3434
## Radio
3535

36-
The crane robot has a [radio](/api/radio) receiver attached to the hook, which can be used to detect which container is below it.
36+
The crane robot has a [radio](/api/radio) receiver attached to the hook, which can be used to detect which container is below it.

content/robots/forklift.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,13 @@ In addition to other sensors, the forklift also has a [microswitch touch sensor]
4040

4141
The forklift has many [ultrasound sensors](/api/ultrasound) attached to various points in the robot, here is the layout of the ultrasound sensors:
4242

43-
- Sensor 0: Front Left
44-
- Sensor 1: Front Right
45-
- Sensor 2: Left
46-
- Sensor 3: Right
47-
- Sensor 4: Front
48-
- Sensor 5: Back
43+
- `AnaloguePin.A0`: Front Left
44+
- `AnaloguePin.A1`: Front Right
45+
- `AnaloguePin.A2`: Left
46+
- `AnaloguePin.A3`: Right
47+
- `AnaloguePin.A4`: Front
48+
- `AnaloguePin.A5`: Back
4949

5050
## Radio
5151

52-
The forklift robot has a [radio](/api/radio) receiver attached to its centre.
52+
The forklift robot has a [radio](/api/radio) receiver attached to its centre.

content/robots/physical.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ The servo will only let you move the grabber in a safe range. `-1` will open the
2020

2121
## Ultrasound
2222

23-
The forklift has an [ultrasound sensor](/api/ultrasound) attached to the front of the robot. This sensor uses pin 4 as the trigger pin and 5 as the echo.
23+
The forklift has an [ultrasound sensor](/api/ultrasound) attached to the front of the robot. This sensor uses digital pin 4 as the trigger pin and 5 as the echo.

0 commit comments

Comments
 (0)