Hi
I want to connect 2x PiicoDev Laser Distance Sensor VL53L1X using the standard PiicoDev cable. I want to use the standard cables for my students’ ease of use (Software Engineering Mechatronics Project).
Both connect fine using the default address but I can’t separate them. This is the code I have tried, but I get the error below. Rather than use the change_addr
method should I jump the IC2 jumpers on the back, but from the docs, I think these are pull-up resistors (although no “PU” printed)?
from PiicoDev_VL53L1X import PiicoDev_VL53L1X
from PiicoDev_Unified import sleep_ms
from time import sleep
# initialise front sensor with default address
distance_front = PiicoDev_VL53L1X()
distance_front.change_addr(0x2B) # change address to 0x2B
sleep(0.5) # wait for 0.5 seconds
# initialise right sensor with default address
distance_right = PiicoDev_VL53L1X(0x29) # initialise sensor B with default address
while True:
distF = distance_front.read()
distR = distance_right.read()
print(
f"Front Distance: {distF}mm - Right Distance: {distR}mm"
) # print both distances on same line
sleep(0.5)
ERROR:
Traceback (most recent call last):
File “”, line 6, in
File “/lib/PiicoDev_VL53L1X.py”, line 112, in init
File “/lib/PiicoDev_VL53L1X.py”, line 136, in reset
File “/lib/PiicoDev_VL53L1X.py”, line 125, in writeReg
OSError: [Errno 5] EIO
Ben