๐ Wiring
The ultrasonic sensor always uses i3 and i4. Put an LED on o1.
Add import ultrasonic. Then distance() gives you the distance in centimetres.
import ultrasonic setup: loop: if distance() < 20: o1 = pwm(100) else: o1 = 0
๐ Your turn
Add a buzzer on o2 that beeps when something is closer than 10 cm.