VL53L0X

83 views
Skip to first unread message

Jayadatta Vallabhaneni

unread,
May 28, 2020, 6:22:08 PM5/28/20
to Pi4J
Want to check if anyone is able to integrate VL53L0X sensor onto PI using Pi4J. If so, can you please share the java code?

Frank Delporte

unread,
May 29, 2020, 5:07:01 AM5/29/20
to Pi4J
This one?

I see that it uses "I2C interface for device control and data transfer".

Here you can find an I2C example for an other type of sensor:

Best regards
Frank

Thomas Aarts

unread,
Jul 1, 2020, 2:29:51 PM7/1/20
to Pi4J
I used the code from the manufacturer ST, written in python and ported it to java.  Since ST does not provide a real datasheet for this chip I relied upon the python author having the required details.  Running the chip against the ST python and my java I see the same distance/TOF results.
Vl53L0X_Declares.java
VL53L0X.java
VL53L0X_simple.java

Thomas Aarts

unread,
Jul 1, 2020, 2:34:07 PM7/1/20
to Pi4J
PS  the chips I have the default address is 0x29.  You can see that value in the 'simple' test driver code.

Jayadatta Vallabhaneni

unread,
Jul 1, 2020, 3:34:20 PM7/1/20
to Pi4J
Thanks Thomas. This is really useful.  Right now, i am exposing VL53L0X as a rest api from Python and calling it in Java. Will try to incorporate your code and update back on the results.

Jim Darby

unread,
Jul 1, 2020, 5:19:23 PM7/1/20
to pi...@googlegroups.com

This is an interesting point. I too have drivers for both specific chips and specific boards. We probably ought to think about some way of sharing these without cluttering up the library too much (or at all).

Perhaps a drivers add on?

Regards,

Jim.

--
You received this message because you are subscribed to the Google Groups "Pi4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pi4j+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pi4j/6ab6c2fa-846e-4b2a-94aa-e8a7426bb874o%40googlegroups.com.

Thomas Aarts

unread,
Jul 2, 2020, 8:26:38 PM7/2/20
to Pi4J
Evening Jim.

Should users have a means to  provide code in support of a particular chip/function ?  Yes
Located as part of the present library or separate ? I think separate.

Everything after that will be a process design discussion.  Some talking points:

Tar
  1. Where to store, likely git.
  2. How distributed, likely tar files.
  3. When to set tags in git to deliver a new tar file
  4. How to add content. Some sort of a Gate keeper,  group or individual.
What is integrated:
  1. Code
  2. Specifics of datasheet used to write the code
  3. Design document. Includes limitations if all chip functionality is not supported
  4. Example usage 
On going support by code provider. Are these items their responsibility?
  1. Regression testing when new Pi supported, or after replacement of the underlying support (ie wiringpi).
  2. Provide fixes
  3. Code updates when new chip revision available

Those are a few items I came up with quickly, each of which could be a discussion on their own.

I have used the pi4j for a few years and found it reliable and well supported. If users are allowed provide code that will be available
through this site I think documented requirements are needed and a gatekeeper.

Tom 






On Wednesday, July 1, 2020 at 4:19:23 PM UTC-5, Jim Darby wrote:

This is an interesting point. I too have drivers for both specific chips and specific boards. We probably ought to think about some way of sharing these without cluttering up the library too much (or at all).

Perhaps a drivers add on?

Regards,

Jim.

On 01/07/2020 20:34, Jayadatta Vallabhaneni wrote:
Thanks Thomas. This is really useful.  Right now, i am exposing VL53L0X as a rest api from Python and calling it in Java. Will try to incorporate your code and update back on the results.


On Wednesday, July 1, 2020 at 11:34:07 AM UTC-7, Thomas Aarts wrote:
PS  the chips I have the default address is 0x29.  You can see that value in the 'simple' test driver code.

On Wednesday, July 1, 2020 at 1:29:51 PM UTC-5, Thomas Aarts wrote:
I used the code from the manufacturer ST, written in python and ported it to java.  Since ST does not provide a real datasheet for this chip I relied upon the python author having the required details.  Running the chip against the ST python and my java I see the same distance/TOF results.


On Thursday, May 28, 2020 at 5:22:08 PM UTC-5, Jayadatta Vallabhaneni wrote:
Want to check if anyone is able to integrate VL53L0X sensor onto PI using Pi4J. If so, can you please share the java code?
--
You received this message because you are subscribed to the Google Groups "Pi4J" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pi...@googlegroups.com.

Frank Delporte

unread,
Jul 5, 2020, 4:03:29 AM7/5/20
to Pi4J
Hello, nice to follow this conversation and see that it fits in the new approach of the in-progress Pi4J V2. From this version on, we really want to focus on the core GPIO I/O functionality. So indeed the specific functionality you want for e.g. VL53L0X doesn't fit in this (new) concept which doesn't include support for specific devices. This will allow to really focus on the core functionality and have this fully tested and stable.

But extensibility is also a core-concept of this V2 with plugins, see https://v2.pi4j.com/documentation/advanced/plugins. The core project includes the minimal plugins to support the Raspberry Pi, PiGpio and MockProvider (for testing) but allows external projects to further extend the functionality.

If you would like to develop this VL53L0X-functionality as a plugin, you can already find some information on the V2-website. Just as Pi4J V2 itself, this website isn't finished yet, but we are actively working on it and any feedback is very welcome!

Best regards
Frank



On Friday, May 29, 2020 at 12:22:08 AM UTC+2, Jayadatta Vallabhaneni wrote:
Reply all
Reply to author
Forward
0 new messages