platypush.plugins.gpio.sensor.distance.vl53l1x

class platypush.plugins.gpio.sensor.distance.vl53l1x.GpioSensorDistanceVl53L1XPlugin(i2c_bus=1, i2c_address=41, **kwargs)[source]

Plugin to interact with an VL53L1x laser ranger/distance sensor

Requires:

  • smbus2 (pip install smbus2)
  • vl53l1x (pip install vl53l1x)
__init__(i2c_bus=1, i2c_address=41, **kwargs)[source]
Parameters:
  • i2c_bus – I2C bus number (default: 1)
  • i2c_address – I2C address (default: 0x29)
get_measurement(short=True, medium=False, long=False)[source]
Parameters:
  • short – Enable short range measurement (default: True)
  • medium – Enable medium range measurement (default: False)
  • long – Enable long range measurement (default: False)
Returns:

dict. Example:

output = {
    "short": 83,     # Short range measurement in mm
    "medium": 103,   # Medium range measurement
    "long": 43,      # Long range measurement
}