树老大 发表于 2024-10-21 08:17:20

530演示代码

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, 18)

tof.set_Vcsel_pulse_period(tof.vcsel_period_type, 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)


页: [1]
查看完整版本: 530演示代码