cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure and access histogram data in VL53L1

vishnusf
Associate III

HI,

Could somebody tell me how to configure and access VL53L1 histogram data in detail.

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

It's easy - buy and use the VL53L1CB. There is a VL53L1CX which is the same chip (almost) but it does not use histograms.

So just do a range with the VL453L1CB and get the result. Under the covers, the histogram is read from the sensor and the answer is obtained. 

There is a call - something like GetAdditionalData() that is in the API

VL53L1_Error VL53L1_GetAdditionalData(VL53L1_DEV Dev,
        VL53L1_AdditionalData_t *pAdditionalData)
it calls (in the core.c)
status = VL53L1_get_histogram_bin_data(
                        Dev,
                        &(pdev->hist_data));
The trick is to know that during the A range you will get 24 historam bins, During the B range you get 4 ambient light levels and 20 bin values. Or maybe its the other way around. I always forget.  
But it's obvious. 
Good luck, 
- john

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.

View solution in original post

1 REPLY 1
John E KVAM
ST Employee

It's easy - buy and use the VL53L1CB. There is a VL53L1CX which is the same chip (almost) but it does not use histograms.

So just do a range with the VL453L1CB and get the result. Under the covers, the histogram is read from the sensor and the answer is obtained. 

There is a call - something like GetAdditionalData() that is in the API

VL53L1_Error VL53L1_GetAdditionalData(VL53L1_DEV Dev,
        VL53L1_AdditionalData_t *pAdditionalData)
it calls (in the core.c)
status = VL53L1_get_histogram_bin_data(
                        Dev,
                        &(pdev->hist_data));
The trick is to know that during the A range you will get 24 historam bins, During the B range you get 4 ambient light levels and 20 bin values. Or maybe its the other way around. I always forget.  
But it's obvious. 
Good luck, 
- john

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.