openmv/scripts/examples/50-Arduino-Boards/Nicla-Vision/51-Sensors/vl53l1x_tof.py
iabdalkader 98a29e0870 scripts/examples: Update examples.
- Add examples index.
- Remove RP2040's Bluetooth examples.
- Resort examples.
2023-10-29 21:21:55 +01:00

15 lines
381 B
Python

# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# 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)