cancel
Showing results for 
Search instead for 
Did you mean: 

Vl53L1X ROI Programming

MBabu.2
Associate II

I have a 3 VL53L1X satel boards with me .I started testing it out and am facing some minor issues. I saw in the data sheet that I can program the Region of Interest. I am programming it in arduino. I was hoping if I can get a sample code with the programable ROI so i can get started. I was also hoping to know how i can change all of the device address and program it in ESP32 if arduino Nano cannot manage 3 I2C devices at once.

Thank you so much in advance

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

The software to get is the STSW-IMG009

VL53L1X ULD API (Ultra Lite Driver Application Programming Interface)

It's free on the ST web site.

Even if you don't use this software it's VERY helpful.

(perhaps you got some software from Sparkfun or Pololu?)

Straight forward and simple.

in there is a function for setting the ROI.

Just call that.

and if you have not started a project yet, the ULD is the best way to go.

The trick to changing the I2C addresses is:

1) put all the sensors in reset (use the Xshut pin)

2)take one out of reset and call the function to change the I2C address.

3) Then take the next one out of reset and change it's address.

4) repeat for each additional chip.

  • john

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.

View solution in original post

3 REPLIES 3
John E KVAM
ST Employee

The software to get is the STSW-IMG009

VL53L1X ULD API (Ultra Lite Driver Application Programming Interface)

It's free on the ST web site.

Even if you don't use this software it's VERY helpful.

(perhaps you got some software from Sparkfun or Pololu?)

Straight forward and simple.

in there is a function for setting the ROI.

Just call that.

and if you have not started a project yet, the ULD is the best way to go.

The trick to changing the I2C addresses is:

1) put all the sensors in reset (use the Xshut pin)

2)take one out of reset and call the function to change the I2C address.

3) Then take the next one out of reset and change it's address.

4) repeat for each additional chip.

  • john

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question. It helps the next guy.
MBabu.2
Associate II

Hello, Does this software work only for ARM processor or can we use the same function in ESP32 also

Thank you

Julien NGUYEN
ST Employee

Hi,

The VL53L1X driver itself is C code. So it works for AMR as well as Arduino. For your work I would process in two steps.

The ESP32 supports Arduino libraries in principle.

  • First step: checkout a L1X Arduino example on the web, compile the example for ESP32 and make it running
  • 2nd step: if you don't find a Arduino example managing the multi-sensor, inspire on the multiple ranging example included in the STSW-IMG009 SW pack indicated by my friend John to make your own to manage the multi-sensors. Generally you start the main program by keeping all sensors on the board to reset with the GPIOs of the ESP32, then set one by one to attribute to them the new I2C address.

Thanks,

Julien


In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.