树莓派论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 30|回复: 0
收起左侧

530演示代码

[复制链接]
发表于 前天 08:17 | 显示全部楼层 |阅读模式
import pycom
import time
from machine import Pin
from machine import I2C
import VL53L0X

i2c = I2C(0)
i2c = I2C(0, I2C.MASTER)
i2c = I2C(0, pins=('P10','P9'))
i2c.init(I2C.MASTER, baudrate=9600)

# Create a VL53L0X object
tof = VL53L0X.VL53L0X(i2c)

tof.set_Vcsel_pulse_period(tof.vcsel_period_type[0], 18)

tof.set_Vcsel_pulse_period(tof.vcsel_period_type[1], 14)


while True:
# Start ranging
    tof.start()
    tof.read()
    print(tof.read())
    tof.stop()


    #q = tof.set_signal_rate_limit(0.1)
    #
    # time.sleep(0.1)


回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|树莓派论坛 ( 粤ICP备15075382号-1  

GMT+8, 2024-10-23 02:52 , Processed in 1.125000 second(s), 26 queries , Gzip On.

Powered by Shumeipai.net! X3.2

© 2001-2015 树莓派论坛安全联盟

快速回复 返回顶部 返回列表