How to use four vl53l0x with one i2c

Hello ALL,
I want to use four VL53L0X in four directions on a helicopter with only one I2C bus. Which part of codes should I make a change or this can be done with Mission Planner?

Hello,

Take a look at this

Thank you for your help!

Thank you for your help! And sorry for disturbing you again!
I have read your blog https://discuss.ardupilot.org/t/avoidance-experiments-with-the-poc-and-benewake-tfmini/25277and I want to confirm that if I want to connect four VL53L0X to the Pixracer, the things I should to is connect them with a single I2C interface and then set the XHUT_pin and set the I2C address in the hwdef.dat? Or anything else should I do?

I think it’s not that easy. You would have to write a startup procedure in Ardupilot which sets the I2C addresses.

Exactly, you need to change address on each sensors and for this you can use the xshut signal pin to disable others sensors that are on same I2C bus.

With LUA scripting it could be done but at the expense of 4 rc channels that would act as gpio to control the xshut signals.

Thank you for your reply!I want to ask you where should I put the LUALUA in ardupilot to run and take effect in the Pixracer? I tried to find it in the github and got no work…

Take a look at the dev wiki
https://ardupilot.org/copter/docs/common-lua-scripts.html

But it requires a bigger FC and the Arduino option is still the best

Thank you very much! And I will take a look at this!

Sorry to bother you again! Can you show me your code to realize the use of multiple VL53L0Xs? I have read the LUA script but didn’t find how to modify the GPIO to change the addresses of VL53L0Xs…
Many thanks for your help!