VL53L1X ToF distance sensor - adapting to micropython
VL53L1X ToF distance sensor - adapting to micropython
Hi guys,
I'm starting to experiment with the new VL53L1X sensor for which there is an Arduino library, and I'd like to port it to micropython.
https://github.com/sparkfun/SparkFun_VL ... no_Library
However I'm no expert and I have to learn a lot, and I'm using I2C to read/write to the correct registers.
It seems like someone wrote a library for the previous model of the sensor, the VL53L0X.
So if anyone is working on the new one please let me know as this would be useful.
Otherwise if I get somewhere I'm happy to share my code.
Thanks
Ben
I'm starting to experiment with the new VL53L1X sensor for which there is an Arduino library, and I'd like to port it to micropython.
https://github.com/sparkfun/SparkFun_VL ... no_Library
However I'm no expert and I have to learn a lot, and I'm using I2C to read/write to the correct registers.
It seems like someone wrote a library for the previous model of the sensor, the VL53L0X.
So if anyone is working on the new one please let me know as this would be useful.
Otherwise if I get somewhere I'm happy to share my code.
Thanks
Ben
Re: VL53L1X ToF distance sensor - adapting to micropython
hi benjam,
did you started experimenting with this in MicroPython?
i have found a python librarie - but have not jet looked at what it needs to get this ported to MicroPython..
https://github.com/pimoroni/vl53l1x-python
and also what it takes to port it to Adafruit CircuitPython
- i think they have a different hardware-abstraction layer -
but have not read the Design Guide (https://circuitpython.readthedocs.io/en ... guide.html) yet..
i will post back here if i get something going..
sunny greetings
stefan
did you started experimenting with this in MicroPython?
i have found a python librarie - but have not jet looked at what it needs to get this ported to MicroPython..
https://github.com/pimoroni/vl53l1x-python
and also what it takes to port it to Adafruit CircuitPython
- i think they have a different hardware-abstraction layer -
but have not read the Design Guide (https://circuitpython.readthedocs.io/en ... guide.html) yet..
i will post back here if i get something going..
sunny greetings
stefan
Re: VL53L1X ToF distance sensor - adapting to micropython
I don’t have any of the mentioned hardware but I have done a lot with the C-layer of micropython.
Quote me if you need help with C-functionality.
Sent from my iPhone using Tapatalk Pro
Quote me if you need help with C-functionality.
Sent from my iPhone using Tapatalk Pro
Re: VL53L1X ToF distance sensor - adapting to micropython
The VL530LX predecessor thread is here: viewtopic.php?t=3358#p19605
@deshipu has created a library for the VL530LX but it does not appear to work for the VL531LX (https://bitbucket.org/thesheep/micropyt ... vl53l0x.py)
Tindie are selling these at only USD10.00 each (https://www.tindie.com/products/blkbox/ ... r-arduino/) which is where I got mine, which is incredible good value given they have a range of up to 4 meters, but I have been unable to get them to work !
@deshipu has created a library for the VL530LX but it does not appear to work for the VL531LX (https://bitbucket.org/thesheep/micropyt ... vl53l0x.py)
Tindie are selling these at only USD10.00 each (https://www.tindie.com/products/blkbox/ ... r-arduino/) which is where I got mine, which is incredible good value given they have a range of up to 4 meters, but I have been unable to get them to work !
Re: VL53L1X ToF distance sensor - adapting to micropython
Has there been any updates? I'm using the same sensor with a v1.1 Pyboard. I watched the videos on how to write a C-wrapper in Micropython, but I don't know how I would have to write it when I have multiple .c and .h files. Could anyone suggest a way to get started?
-
- Posts: 847
- Joined: Mon Nov 20, 2017 10:18 am
Re: VL53L1X ToF distance sensor - adapting to micropython
I have used this sensor with micropython but it was quite a while ago now. I did defiantly use
I looked through my videos and found a video that I made to send to someone that I was helping use the sensor. https://www.youtube.com/watch?v=jLUuA2j ... e=youtu.be
and it worked for me.@deshipu has created a library for the VL530LX but it does not appear to work for the VL531LX (https://bitbucket.org/thesheep/micropyt ... vl53l0x.py)
I looked through my videos and found a video that I made to send to someone that I was helping use the sensor. https://www.youtube.com/watch?v=jLUuA2j ... e=youtu.be
Re: VL53L1X ToF distance sensor - adapting to micropython
Hello everyone,
I know this is quite old, but I'm a bit out of ideas in getting this sensor to work.
The library which is linked in this thread is not available anymore, so I'm using https://github.com/uceeatz/VL53L0X
Now my problem is that this library is coming from a pycom wipy board, which I do not have. When trying on my ESP32, I get an error that tells me that the module 'Timer' doesn't have an attribute 'Chrono'.
From what I understand, it is only used to 'perform_single_ref_calibration', and used as a timer.
Is there a possibility to port the 'Chrono' part to ESP32? Or is that a specialty of the pycom boards?
Or, better yet, could someone provide me with the alternate library?
Best regards,
Chris
I know this is quite old, but I'm a bit out of ideas in getting this sensor to work.
The library which is linked in this thread is not available anymore, so I'm using https://github.com/uceeatz/VL53L0X
Now my problem is that this library is coming from a pycom wipy board, which I do not have. When trying on my ESP32, I get an error that tells me that the module 'Timer' doesn't have an attribute 'Chrono'.
From what I understand, it is only used to 'perform_single_ref_calibration', and used as a timer.
Is there a possibility to port the 'Chrono' part to ESP32? Or is that a specialty of the pycom boards?
Or, better yet, could someone provide me with the alternate library?
Best regards,
Chris
Re: VL53L1X ToF distance sensor - adapting to micropython
Yes this is a pycom feature.
However, it's functionaly just a way of measuring how much time has passed. Short for "Chronograph" (or "stopwatch").
In MicroPython you can just use the time.ticks_ms() to get the current uptime in ms, and time.ticks_diff() to get the difference between two values.
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: VL53L1X ToF distance sensor - adapting to micropython
I was sufficiently intrigued by this device to spend some time researching it. Unfortunately I couldn't locate a programming manual. This is odd as STM usually document their kit extensively. These links might be of interest.
https://github.com/adafruit/Adafruit_Ci ... vl53l0x.py Adafruit driver for VL53L0X - a device with more limited range.
https://www.l33t.uk/ebay/vl53l1x/
https://github.com/pololu/vl53l1x-arduino Driver written in C.
The Pymoroni library https://github.com/pimoroni/vl53l1x-python referenced by @s-light above uses a .so library which is a Linux equivalent to a DLL. This is effectively a binary blob. As far as I know MicroPython has no support for such files.
I've ported a number of C drivers to MicroPython so I considered porting the Pololu driver. However it's a complex driver. And in every case where I've ported a driver from C to MicroPython I've had access to a programming manual and needed it. Perhaps someone more skilled or braver will tackle it.
I'd go for the VL53L0X and try to track down @deshipu's driver; or, failing that, port the Adafruit one. But there doesn't seem to be a manual for that device either...
https://github.com/adafruit/Adafruit_Ci ... vl53l0x.py Adafruit driver for VL53L0X - a device with more limited range.
https://www.l33t.uk/ebay/vl53l1x/
https://github.com/pololu/vl53l1x-arduino Driver written in C.
The Pymoroni library https://github.com/pimoroni/vl53l1x-python referenced by @s-light above uses a .so library which is a Linux equivalent to a DLL. This is effectively a binary blob. As far as I know MicroPython has no support for such files.
I've ported a number of C drivers to MicroPython so I considered porting the Pololu driver. However it's a complex driver. And in every case where I've ported a driver from C to MicroPython I've had access to a programming manual and needed it. Perhaps someone more skilled or braver will tackle it.
I'd go for the VL53L0X and try to track down @deshipu's driver; or, failing that, port the Adafruit one. But there doesn't seem to be a manual for that device either...
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: VL53L1X ToF distance sensor - adapting to micropython
There are backups of all my repositories that Bitbucket deleted available here: https://bitbucket-archive.softwareherit ... /thesheep/pythoncoder wrote: ↑Fri Oct 02, 2020 8:02 amI'd go for the VL53L0X and try to track down @deshipu's driver;