Abstract-Horizon / vl53l5cx_python

Python transliteration of VL53L5CX ultra lite driver from C to Python. Current implementation is tested on Raspberry Pi with SMBus2 for i2c communication.
Apache License 2.0
6 stars 6 forks source link

VL53L5CX ctypes Python library #1

Open Gadgetoid opened 2 years ago

Gadgetoid commented 2 years ago

Hello! :wave:

I've just finished authoring a VL53L5CX Python library to support our sensor breakout.

It builds the official C ULD driver and interfaces with it using ctypes, using Python to wrap the raw library in a friendlier class. The i2c platform implementation uses pointers and the Python library supplies functions wrapping smbus2 (or any compatible interface). See: https://github.com/pimoroni/vl53l5cx-python

It wasn't until I tried to push it to test pypi that I came across this implementation :facepalm:

I suspect some of our customers will find our way to your library since it seems pretty comprehensive and there are definitely advantages to a pure Python approach. Give me a shout if you need anything.

We've got some visual examples that may port nicely to your library- these treat the 8x8 ranging field as a 2D array, convert it to an image, add false colour and display it on an LCD. Not very practical, but they may be interesting none the less.

(Sheesh I wish I'd found this sooner, the chunked i2c needed on Pi - and RP2040 for that matter - gave me an enormous headache.)