adafruit_lidarlite
¶
A CircuitPython & Python library for Garmin LIDAR Lite sensors over I2C
Author(s): ladyada, johnrbnsn
Implementation Notes¶
Hardware:
Software and Dependencies:
Adafruit CircuitPython firmware for the supported boards: https://github.com/adafruit/circuitpython/releases
Adafruit’s Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice
- adafruit_lidarlite.CONFIG_LOWSENSITIVE = 5¶
Status Registers
- class adafruit_lidarlite.LIDARLite(i2c_bus, *, reset_pin=None, configuration=0, address=98, sensor_type='V3')¶
A driver for the Garmin LIDAR Lite laser distance sensor.
Initialize the hardware for the LIDAR over I2C. You can pass in an optional reset_pin for when you call reset(). There are a few common configurations Garmin suggests: CONFIG_DEFAULT, CONFIG_SHORTFAST, CONFIG_DEFAULTFAST, CONFIG_MAXRANGE, CONFIG_HIGHSENSITIVE, and CONFIG_LOWSENSITIVE. For the I2C address, the default is 0x62 but if you pass a different number in, we’ll try to change the address so multiple LIDARs can be connected. (Note all but one need to be in reset for this to work!)
- Parameters
- configure(config)¶
Set the LIDAR desired style of measurement. There are a few common configurations Garmin suggests: CONFIG_DEFAULT, CONFIG_SHORTFAST, CONFIG_DEFAULTFAST, CONFIG_MAXRANGE, CONFIG_HIGHSENSITIVE, and CONFIG_LOWSENSITIVE.
- property correlation_data¶
Reads correlation data
- property distance¶
The measured distance in cm. Will take a bias reading every 100 calls
- property health_status¶
Reads health status for v3HP (not available on v3, will return -1)
- property i2c_config¶
Reads the I2C config
- property power_control¶
Reads the power control register
- read_distance_v3(bias=False)¶
Perform a distance reading with or without ‘bias’. It’s recommended to take a bias measurement every 100 non-bias readings (they’re slower)
- read_distance_v3hp()¶
Perform a distance measurement for the v3 HP sensor
- reset()¶
Hardware reset (if pin passed into init) or software reset. Will take 100 readings in order to ‘flush’ measurement unit, otherwise data is off.
- property signal_strength¶
Reads the signal strength of the last measurement
- property status¶
The status byte, check datasheet for bitmask
- property test_command¶
Reads the test command
- property unit_id¶
Reads the serial number of the unit