Using a VL5310x ToF sensor on the micro:bit

Questions and discussion about running MicroPython on a micro:bit board.
Target audience: MicroPython users with a micro:bit.
djsbriscoe
Posts: 1
Joined: Sun Apr 09, 2017 8:06 am

Using a VL5310x ToF sensor on the micro:bit

Postby djsbriscoe » Sun Apr 09, 2017 8:20 am

Hi,
I'm new to the Microbit but have some experience with microcontrollers (PIC and Arduino using C) and I'm just learning Python.
I would like to know how I can use an ST VL5310x Time of Flight sensor with my Microbit. The VL6180X sensor is mentioned here

viewtopic.php?t=2919

and there is a python file mentioned here for the VL6180X

viewtopic.php?f=14&t=1902

How could this file be adapted and used with the MicroBit? Is it possible to make changes to the hexadecimal numbers(addresses?) in this file by referring to the datasheet for the VL5310X? What do I have to do then to get this to work?How would a python file be included in the source code in mu for instance?
I hope someone can help? Thanks.

David.

User avatar
deshipu
Posts: 1149
Joined: Thu May 28, 2015 5:54 pm

Re: Using a VL5310x ToF sensor on the micro:bit

Postby deshipu » Mon Apr 10, 2017 7:14 am

Unfortunately it's a little bit more complex than just changing a couple of numbers. The VL5310x has a lot of registers that have to be initialized to correct values for it to work properly, and they are different than with VL6180x. I started writing a driver for it, based on Pololu code here https://github.com/pololu/vl53l0x-arduino but I didn't get very far yet.

User avatar
deshipu
Posts: 1149
Joined: Thu May 28, 2015 5:54 pm

Re: Using a VL5310x ToF sensor on the micro:bit

Postby deshipu » Sat May 13, 2017 9:16 pm

Having just implemented a library for this sensor for MicroPython I must say that I don't think the Micro:bit will ever be able to properly drive that sensor. The amount of code required to set all the magical registers to their proper values is simply too large. I would recommend using an analog distance sensor, such as the ones produced by SHARP -- they are super-easy to use.


Return to “The micro:bit”

Who is online

Users browsing this forum: No registered users and 1 guest