adafruit_vl53l1x module

adafruit_vl53l1x

CircuitPython module for interacting with the VL53L1X distance sensor.

  • Author(s): Carter Nelson

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_vl53l1x.VL53L1X(i2c, address=41)

Bases: object

Driver for the VL53L1X distance sensor.

Parameters:
  • i2c (machine.I2C) – I2C bus corresponding to TOF.

  • address (int, optional) – I2C address of TOF. Defaults to 41.

Raises:

RuntimeError – Detected model/serial number doesn’t match requirements for use in driver.

clear_interrupt()

Clears new data interrupt.

property data_ready

Returns true if new data is ready, otherwise false.

property distance

The distance in units of millimeters.

property distance_mode

The distance mode. 1=short (up to 136cm) , 2=long (up to 360cm).

property model_info

A 3 tuple of Model ID, Module Type, and Mask Revision.

set_address(new_address: int)

Change the sensor I2C device address.

Parameters:

new_address (int) – I2C address to change the device to use.

start_ranging()

Starts ranging operation.

stop_ranging()

Stops ranging operation.

property timing_budget

Ranging duration in milliseconds.

Increasing the timing budget increases the maximum distance the device can range and improves the repeatability error. However, average power consumption augments accordingly. ms = 15 (short mode only), 20, 33, 50, 100, 200, 500. Defaults to 50.