Patience is a virtue and you guys have waited long enough (I hope).
I took delivery of a couple of these breakout boards a while back and decided to have a crack at the code.
European chip maker STMicroelectronics publishes no real detail or register map but you can download a zip file containing their application program interface.
In exchange for my email address I did this and pasted all code segments into one Word document to make following links easier. The total was 209 pages and 10,910 lines of c code! This is a significant corporate investment but was it to achieve “added value” or obfuscation? It does seem unlikely that a Picaxe could handle this.
Adafruit and Pololu provide library routines based on the API, cleaned up and suitable for c++. I must have messed up the Adafruit version as the compiler claimed insufficient memory. Pololu worked first time and I was able to see range values streaming down the screen.
Of course I had to use an Arduino Nano for the ‘forensic iconoclasm’. I soon began to suspect the involvement of the Wizard of Oz but it took some weeks to show how things could be behind the curtain. Translating the results for the Picaxe was the final test - I would appreciate others trying this out:
;14M2 VL53L0X Demonstration
;i2c interface pin9 SDA, pin10 SCL
init: hi2csetup i2cmaster, 82, i2cfast, i2cbyte
sertxd ("ToF Test ",cr,lf)
;read product ID at 0xC0 to prove i2c working
;should show 238,170,16 (0xEE,0xAA,0x10)
hi2cin 0xC0,(b3,b4,b5)
sertxd (#b3," ",#b4," ",#b5,cr,lf)
main: hi2cout 0x00,(0x01) ;and re-arm
pause 200
;read the range in mm from 0x1E
hi2cin 0x1E,(b3,b2)
w2 = b3
w2 = w2 * 256
w2 = w2 | b2
sertxd (#time," ",#w2,cr,lf)
goto main
end
Poor quality video of a simple range test included for verification:
If this works for you and you need multiple sensors then the chip has a soft address at register 0x8A. When it boots up again it will revert to 0x29 (note the shifted value needed in i2csetup).
The next video clip shows the comparison against the HC-SR04 ultrasonic unit which I have used many times - but it is big and unsightly in some situations. You can see how viewing the tiny laser via an electronic camera shows the cone of pulsed light.
When used to construct a point cloud, there is an accuracy problem that others have reported. This video clip shows one experiment with a humorous but unhappy conclusion.
I began my interest after studying Gareth’s LIDAR project at:
https://www.robotrebels.org/index.php?topic=869.0