跳转到主要内容

适用于Raspberry Pi的VL53L1X距离传感器驱动程序

项目描述

vl53l1x-python

VL53L1X激光测距仪的Python库。

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

安装

sudo pip install smbus2
sudo pip install vl53l1x

使用

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()

查看示例以了解更高级的使用方法。

0.0.5

  • 增强:由于@jinnie的支持,支持ROI

0.0.4

  • 增强:支持tca9548a,针对#13
  • 增强:支持更改i2c地址,针对#14
  • 增强:支持设置时间预算,针对#16
  • 与ST的最新发布同步API代码

0.0.3

  • 修复:使用i2c_bus参数用于备用总线/软i2c

0.0.2

  • 改进搜索.so文件以获取特定架构的文件

0.0.1

  • 首次发布

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源分布

VL53L1X-0.0.5.tar.gz (182.3 kB 查看哈希值)

上传时间:

构建分布

VL53L1X-0.0.5-cp37-cp37m-linux_armv7l.whl (149.1 kB 查看哈希值)

上传时间: CPython 3.7m

VL53L1X-0.0.5-cp35-cp35m-linux_armv7l.whl (121.6 kB 查看哈希值)

上传时间 CPython 3.5m

VL53L1X-0.0.5-cp27-cp27mu-linux_armv7l.whl (148.8 kB 查看哈希值)

上传时间 CPython 2.7mu

由以下组织支持

AWS AWS 云计算和安全赞助商 Datadog Datadog 监控 Fastly Fastly CDN Google Google 下载分析 Microsoft Microsoft PSF 赞助商 Pingdom Pingdom 监控 Sentry Sentry 错误记录 StatusPage StatusPage 状态页面