Skip to main content

vl53l1x distance sensor driver for Raspberry Pi

Project description

vl53l1x-python

Python library for the VL53L1X Laser Ranger.

https://shop.pimoroni.com/products/vl53l1x-breakout

Installing

sudo pip install smbus2
sudo pip install vl53l1x

Usage

import VL53L1X

# Open and start the VL53L1X sensor.
# If you've previously used change-address.py then you
# should use the new i2c address here.
# If you're using a software i2c bus (ie: HyperPixel4) then
# you should `ls /dev/i2c-*` and use the relevant bus number.
tof = VL53L1X.VL53L1X(i2c_bus=1, i2c_address=0x29)
tof.open()

# Optionally set an explicit timing budget
# These values are measurement time in microseconds,
# and inter-measurement time in milliseconds.
# If you uncomment the line below to set a budget you
# should use `tof.start_ranging(0)`
# tof.set_timing(66000, 70)

tof.start_ranging(1)  # Start ranging
                      # 0 = Unchanged
                      # 1 = Short Range
                      # 2 = Medium Range
                      # 3 = Long Range

# Grab the range in mm, this function will block until
# a reading is returned.
distance_in_mm = tof.get_distance()

tof.stop_ranging()

See examples for more advanced usage.

0.0.5

  • Enhancement: support for ROI thanks to @jinnie

0.0.4

  • Enhancement: support for tca9548a, for #13
  • Enhancement: support for i2c address change, for #14
  • Enhancement: support for setting timing budget, for #16
  • Synced API code with latest release from ST

0.0.3

  • Fix: Use i2c_bus param for use with alternate buses/soft i2c

0.0.2

  • Improved search for .so file to pick up arch-specific files

0.0.1

  • Initial release

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

VL53L1X-0.0.5.tar.gz (182.3 kB view details)

Uploaded Source

Built Distributions

VL53L1X-0.0.5-cp37-cp37m-linux_armv7l.whl (149.1 kB view details)

Uploaded CPython 3.7m

VL53L1X-0.0.5-cp35-cp35m-linux_armv7l.whl (121.6 kB view details)

Uploaded CPython 3.5m

VL53L1X-0.0.5-cp27-cp27mu-linux_armv7l.whl (148.8 kB view details)

Uploaded CPython 2.7mu

File details

Details for the file VL53L1X-0.0.5.tar.gz.

File metadata

  • Download URL: VL53L1X-0.0.5.tar.gz
  • Upload date:
  • Size: 182.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.3

File hashes

Hashes for VL53L1X-0.0.5.tar.gz
Algorithm Hash digest
SHA256 5f05a1197769c98c36d762a90b66d50a2a9c50e83a265343435eb3d3b0874ef4
MD5 52457cc068aa881e6857ee5acf5265ce
BLAKE2b-256 75961cf8e9de743c8d8393ce7654ebde00171f1090844e5324d52a59ad140770

See more details on using hashes here.

File details

Details for the file VL53L1X-0.0.5-cp37-cp37m-linux_armv7l.whl.

File metadata

  • Download URL: VL53L1X-0.0.5-cp37-cp37m-linux_armv7l.whl
  • Upload date:
  • Size: 149.1 kB
  • Tags: CPython 3.7m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for VL53L1X-0.0.5-cp37-cp37m-linux_armv7l.whl
Algorithm Hash digest
SHA256 b234bb62e2e365815f72f73c3ccc5ef5ad6fe8ebc584cf33d51e3bcb98bc9ae7
MD5 61322db3de113c8558944b90e41bf578
BLAKE2b-256 df057aff24243ae12ac1b8b1f1721e9ee6460be7373f71cce795fe2b79bae2d7

See more details on using hashes here.

File details

Details for the file VL53L1X-0.0.5-cp35-cp35m-linux_armv7l.whl.

File metadata

  • Download URL: VL53L1X-0.0.5-cp35-cp35m-linux_armv7l.whl
  • Upload date:
  • Size: 121.6 kB
  • Tags: CPython 3.5m
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.5.3

File hashes

Hashes for VL53L1X-0.0.5-cp35-cp35m-linux_armv7l.whl
Algorithm Hash digest
SHA256 ac40f5dcfb2f315cf993e09fb4f7b97cb28a6bba185f7223b32af823fbb1929a
MD5 1428a9c5250ec5422324b2035ca2906a
BLAKE2b-256 e981e97088fed506f10ffd92045dae924faa124069251fb25ea62771cd1aec9a

See more details on using hashes here.

File details

Details for the file VL53L1X-0.0.5-cp27-cp27mu-linux_armv7l.whl.

File metadata

  • Download URL: VL53L1X-0.0.5-cp27-cp27mu-linux_armv7l.whl
  • Upload date:
  • Size: 148.8 kB
  • Tags: CPython 2.7mu
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/43.0.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for VL53L1X-0.0.5-cp27-cp27mu-linux_armv7l.whl
Algorithm Hash digest
SHA256 6afa05c51814731b69cdc0ff499a9e24e9b200f3d79cee218c11705cda2b668d
MD5 bdb148703b17f2eb8eda1a567f37857e
BLAKE2b-256 0df1f660f3155aa2204302441d21cf809a4051e4ed69ecbca49ac922ff13e985

See more details on using hashes here.

Supported by

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