measure distance by two Lidar-lite v3 using arduino - pay for this 40$ by paypal

Reading the data sheet it seems a measurement is only done upon request (i.e. writing 0x04 to register 0x00).

Switching of the device, or putting it in sleep mode, should not be necessary. The data sheet (page 5, "Burst Measurements and Free Running Mode") mentions the default is to take just a single measurement when the command is given to do so.

Anyway, cleaned up the code, added support for multiple devices (each on a unique I2C address), and moved it to a separate function so you can much easier reuse it.

The code compiles and I'm quite positive will work (I've followed the data sheet for the registers - it seems your code for a single device is correct) but can't test it as I don't have the exact device here.