Ultrasonic Distance Sensor
The StudioBot has an ultrasonic distance located at the front of the robot. These look like the 'eyes' of the robot.

import time
import board
from StudioBot import *
while True:
try:
print(sonar.get_distance())
except RuntimeError:
print("Retrying!")
time.sleep(0.1)Last updated