Trying to take advantage of the multiple I2C ports on the T3.6, but so far no luck.
I am using the latest VL53L1X library from Pololu, and Pololu sensors.
I’m using the Arduino IDE version 1.8.15
the github site…
mentions this approach, but it throws an error:
void setBus(TwoWire * bus)
Configures this object to use the specified I²C bus. bus should be a pointer to a TwoWire object; the default bus is Wire, which is typically the first or only I²C bus on an Arduino. If your Arduino has more than one I²C bus and you have the VL53L0X connected to the second bus, which is typically called Wire1, you can call sensor.setBus(&Wire1);.
I can compile those ok. I have not tested them in hardware but I do not have the xSHUT pins connected, trying not to use that approach to reduce wiring complexity and improve latency.
I have been able to use one sensor at a time in the past, so I think the hardware is good.
I did upgrade the library to 1.3.1, but that also fails to compile with the &Wire1 or &Wire2 approach.
Where are you calling setBus() from? I suspect you’re trying to do it from outside a function, i.e. right after your VL53L1X_left object is declared (globally), which will not work. Instead, you will need to call it from inside a function, probably setup():
If that does not help, could you post the entire program that you are having trouble with (either inside a code block in a post or as a file attachment)?