I am trying to evaluate various distance sensor modules for use in a package dimensioning application. The requirements are a range of about 1 inch to 48", with an accuracy of 1/4". One of the prime candidates is the VL53L0X 'time of flight' laser sensor: http://www.st.com/en/imaging-and-photonics-solutions/vl53l0x.html. Experimenting with this particular device presents a two-fold challenge: it is a complex device with about 100 registers and a rather poor data sheet, and then there is the TWI implementation, one of the XMEGA features I have not used till now. Although the maker (ST Electronics) provides an app, it is widely considered opaque and useless by most of the community (the manual is about 180 pages). To evaluate, I would like to be able to at least read and write registers. Can anyone provide a link or suggestion to a C implementation of the TWI routines to do basic register access? There is lots of info on Github and other sources for Arduino drivers, but of course they are for the ATMEGA328, with a different TWI implementation, and a different set of constants, bit masks, and defines. What would be ideal would be a simple set of C functions to read and write VL53L0X registers (8 and 16 bit) specifically for the XMEGA. I will mention that I am using the XMEGA128A1U because it has 4 TWI ports, and I need 3 of them for the X,Y, and Z axes. Besides, I really like the XMEGA family, great variety and features!
In addition, I am open to suggestions for other sensors that might work well in this application. I now have an Adafruit VL53L0x module, that I am currently trying to bring up (subject of this post). I have also looked at the Lidar-Lite V3 unit, very disappointing at $130, poor linearity and accuracy below about a foot. This was attractive because of its available PWM mode, requiring only on I/O pin to measure distance (although it is basically an I2C device). Slated for evaluation in the coming week(s), the Mikroelectronica 'Proximity 3 click' (laser), the Parallax 'Ping)))' (ultrasonic), and the Parallax 'Laser Range Finder 2M', p/n 28044 (camera triangulation). The latter device is very attractive because it has a dead simple ttl serial i/f. if anyone has experience with any of these, pro or con, I would love to hear about it. My online research so far indicates that most of these devices fail to live up to their published accuracy specifications. This all started because it was recommended that I hack the Bosch GLM20 laser ruler, available at hardware stores for about $50. This device seems to be the gold standard of what I am looking for, (1/8" accuracy up to 65 feet) , but unfortunately Bosch does not make the guts available as an OEM product. If they did this would be the perfect sensor for robotics, drones, etc (are you listening Bosch?).
Suggestions and comments welcome!