cancel
Showing results for 
Search instead for 
Did you mean: 

hello everybody, I'm are new on STM and nowhere find the answer, how to read the distance using VL53LOX on NucleoF411RE? I want to do distance using CubeIDE. There is no registers or something else. The exampes which are on 'st' internet page, works.

msavi.11
Associate II
 
2 REPLIES 2
John E KVAM
ST Employee

With the VL53L0X there are an absurdly large number of registers. So many we don't expect you to bother reading them. Better to use the API. The API is code delivered to your project when you use STM32CubeMX and build your project.

Just tell the MX code that you have the VL53L0X and the code will be inserted in your project.

(I say "just" but this takes a fair bit of figuring out. I never get it right the first few times. But it's possible. I've seen people do it.)

After you build in the API into your CubeMX project, the created code will work. Next, I'd steal the example code and push it around a bit to make it do what you want.

It's a matter of calling the init function, setting a few timings by calling API funtions, calling the start routing, waiting until it's done (or getting the interrupt) reading the data and clearing the interrupt.

There are functions for all of this. The example code shows you how.


If this or any post solves your issue, please mark them as 'Accept as Solution' It really helps. And if you notice anything wrong do not hesitate to 'Report Inappropriate Content'. Someone will review it.
msavi.11
Associate II

Hello, with examples is everything okay, it's work. But the huge problem is to run it on my code, such you have a "function" which control a VL53L0X device and just call it on 'while' cycle, like you have a same sensor with registers , which value you have to read. There is no VL53L0X on CubeIDE, there is just 53L3A2, 53L5A1, VL53L3CX and etc.

P.S. Sorry, my english lanuage is so poor....