mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
12 lines
223 B
Python
12 lines
223 B
Python
# VL53L1X ToF sensor basic distance measurement example.
|
|
from machine import I2C
|
|
from vl53l1x import VL53L1X
|
|
import time
|
|
|
|
tof = VL53L1X(I2C(2))
|
|
|
|
while True:
|
|
print(f"Distance: {tof.read()}mm")
|
|
time.sleep_ms(50)
|
|
|