Recently I obtained several VL53L0X ToF sensors and after being impressed with their capabilities, I wanted to add these to a project I am working on that is written entirely in Python.I found that there are a few Python interfaces that perform the basics but none that provide the full capability and configuration afforded by the ST Library. Since porting the entire ST Library to Python would be time consuming and prone to error, I instead created the necessary Python code to interface the ST Library into Python. In order to maintain compatibility with other Python code that accesses the I2C bus, the I2C interface is performed via callbacks to the Python smbus interface in the ST Library platform layer. The Python code/Interface library includes a simplified interface to the VL53L0X which allows for configuring the sensor into 4 different accuracy modes with a simple call. Currently this Python code only provides access to a single sensor but I am working on adding simplified access to multiple sensors. The code can be found at:
Comments and suggestions are appreciated.
Please note that I am a novice at Python but have been an embedded software engineer for 25 years. If Python experts know of a better/more efficient way to do any of this, please let me know.