Skip to main content

VL53L3CX distance sensor driver for Raspberry Pi

Project description

VL53L3CX Python

Simple library for interacting with VL53L3CX sensors via python. This project is based on the VL53L0X_rasp_python project by John Bryan Moore.

Connect your VL35L3CX module of choice via V+, GND, I2C clock, I2C data and xshut if you are using more then one sensor. The default address is 0x29. If you are using more sensors, drive the xshut high for all sensors but one, change address, then drive next xshut low, change address and repeat the process until all sensors have unique addresses.

(Note that there is no support for multiplexers as I originally built this for my own use and later I thought to myself the library might come in handy for someone and it is probably worth sharing.)

Installing

pip install VL53L3CX

Usage

Look into examples to get basic gist of the usage. There are two simple python scripts - distance and change-address that probably cover all the usage cases you would ever need.

Basic functions are:
VL53L3CX.open() - starts I2C
VL53L3CX.start_ranging() - starts the sensor itself
VL53L3CX.stop_ranging() - stops the sensor
VL53L3CX.get_distance() - returns the measured distance in millimeters, should be called with if VL53L3CX.is_ranging_ready():
VL53L3CX.is_ranging_ready() - returns true if sensor is ready to be read
VL53L3CX.change_address(new_address) - changes the current I2C address to a new one specified

Not properly tested bonus functions I didn't end up using:
VL53L3CX.set_distance_mode(mode) - set distance mode to 1-short, 2-medium, 3-long
VL53L3CX.set_timing_budget(timing_budget) - in microseconds
VL53L3CX.wait_for_data() - interrupt the program until data is ready

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vl53l3cx-1.0.1.tar.gz (100.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vl53l3cx-1.0.1-cp39-cp39-linux_armv7l.whl (294.0 kB view details)

Uploaded CPython 3.9

File details

Details for the file vl53l3cx-1.0.1.tar.gz.

File metadata

  • Download URL: vl53l3cx-1.0.1.tar.gz
  • Upload date:
  • Size: 100.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.2

File hashes

Hashes for vl53l3cx-1.0.1.tar.gz
Algorithm Hash digest
SHA256 f8f1ad33e0f1b69415705737c487b71ff4057dd245c11b048a3ff6ea0f851b75
MD5 958bf9743e9edbc7bbb5f8febd833134
BLAKE2b-256 6b126ca5082b172ce219ded21febf8ab6f9f19871bab6d3864b16548cfc5f843

See more details on using hashes here.

File details

Details for the file vl53l3cx-1.0.1-cp39-cp39-linux_armv7l.whl.

File metadata

File hashes

Hashes for vl53l3cx-1.0.1-cp39-cp39-linux_armv7l.whl
Algorithm Hash digest
SHA256 4def69c2830827130ccc0e4a9579889031e4fb7d4439f6af63584e9596b76de7
MD5 66f4d7f5ba13ac4dc96ac57516e70b34
BLAKE2b-256 3b070f701e67674aa62616940c9cd1a813b76def675cb4a844ce5b7408c76875

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page