Skip to main content
MBabu.2
Associate II
March 30, 2021
Solved

Vl53L1X ROI Programming

  • March 30, 2021
  • 3 replies
  • 1929 views

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

This topic has been closed for replies.
Best answer by John E KVAM

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

3 replies

John E KVAM
John E KVAMBest answer
ST Employee
March 30, 2021

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
MBabu.2
MBabu.2Author
Associate II
March 31, 2021

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
March 31, 2021

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