Skip to content

Commit ec162bc

Browse files
Expand calculation to avoid magic numbers
1 parent 9ffb592 commit ec162bc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

simulator/simulated_robot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ You can access the ultrasound sensors using `robot.arduino.pins[AX]`, where '`AX
9494
```python
9595
reading = R.arduino.pins[A5].analog_read()
9696
# convert reading from volts to meters
97-
measurement = reading / 2.5
97+
measurement = reading / (5/2)
9898
print(f"Rear ultrasound distance {measurement:.2f} meters")
9999
```
100100

0 commit comments

Comments
 (0)