Skip to content

Commit 749ccdd

Browse files
committed
Add Ultrasound sensors
1 parent cc8f5b2 commit 749ccdd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

docs/api/arduino.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,17 @@ pin_value = r.arduino.pins[AnaloguePin.A0].analogue_value
105105

106106
!!! warning
107107
Pins `A4` and `A5` are reserved and cannot be used.
108+
109+
## Ultrasound Sensors
110+
111+
You can also measure distance using an ultrasound sensor from the arduino.
112+
113+
```python
114+
# Trigger pin: 4
115+
# Echo pin: 5
116+
117+
distance_metres = r.arduino.ultrasound_measure(4, 5)
118+
```
119+
120+
!!! warning
121+
The ultrasound sensor can measure distances up to 2 metres. If the ultrasound signal has to travel further than 2m, the sensor will timeout and return `None`.

0 commit comments

Comments
 (0)