pimoroni / vl53l1x-python

Python library for the VL53L1X Laser Ranger
https://shop.pimoroni.com/products/vl53l1x-breakout
94 stars 53 forks source link

Fix I2C interface bug #44

Closed jhoecker closed 2 years ago

jhoecker commented 3 years ago

I noticed some data inconsistencies while reading data from the vl53l1x using your python lib (as also mentioned in #35). ST provides some registry entries to check the i2c interface validity (see the vl53l1x data sheet https://www.st.com/resource/en/datasheet/vl53l1x.pdf on page 22). All are set to 0xff when read in current master which is not correct. This bugs derive from my point of view from wrong data types in the i2c_read and i2c_write functions. This pull request fixes the issue as well as corrupted data in long data fields as i.g mentioned in #35. I also added some debug output for reading the mentioned registry entries and a warning if the values are not correct.

Gadgetoid commented 2 years ago

Thank you, good grief this has flown under my radar for a while. I'm weedwhacking through my backlog of PRs, however, and will investigate.