Skip to main content
Associate II
December 12, 2024
Solved

Vl53l8 configuring the ranging frequency

  • December 12, 2024
  • 1 reply
  • 572 views

Hi,

I am using the VL53l8 sensor. i need to change the ranging frequency. im using the Xcube tof code. I see in the app tof code that #define RANGING_FREQUENCY (10U). so if i change 10u to 15. Willi get ranging frequency to 15 hz.?

 

Thank u 

Best answer by John E KVAM

that should work just fine. 

and, as you are using an STM32, go ahead and insert:

//Counting cycles is a piece of cake. 
//Stick this code somewhere in your code.

 cur_timestamp = HAL_GetTick();
 printf("%4lums \n",cur_timestamp - prev_timestamp);
 prev_timestamp = cur_timestamp;

Each tick is a ms. - but remember that there is going to be a roll-over at some point. But it's great for just testing!!

1 reply

John E KVAM
John E KVAMBest answer
ST Employee
December 13, 2024

that should work just fine. 

and, as you are using an STM32, go ahead and insert:

//Counting cycles is a piece of cake. 
//Stick this code somewhere in your code.

 cur_timestamp = HAL_GetTick();
 printf("%4lums \n",cur_timestamp - prev_timestamp);
 prev_timestamp = cur_timestamp;

Each tick is a ms. - but remember that there is going to be a roll-over at some point. But it's great for just testing!!