cancel
Showing results for 
Search instead for 
Did you mean: 

VL53L1: What is the data format for the offset calibration parameters?

MVand.3
Associate II
VL53L1_PerformOffsetCalibration(Dev, 140, 17 << 16)

From digging in the code it looks like CalReflectancePerCent is fixpoint1616 and CalDistanceMilliMeter is an int32. For example is this the correct format to calibrate with a 17% Grey card at 140mm?

1 ACCEPTED SOLUTION

Accepted Solutions
John E KVAM
ST Employee

I would have said no, that clearly makes no sense.

But I'd be wrong.

Looking through some example code, I saw:

Status = VL53L1_PerformOffsetCalibration(Dev, 600,

(FixPoint1616_t)(5 * 65536));

which clearly is an example of your <<16.

I have no idea how someone could have created such a trap.

But they clearly did.

Nice catch.


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

2 REPLIES 2
John E KVAM
ST Employee

I would have said no, that clearly makes no sense.

But I'd be wrong.

Looking through some example code, I saw:

Status = VL53L1_PerformOffsetCalibration(Dev, 600,

(FixPoint1616_t)(5 * 65536));

which clearly is an example of your <<16.

I have no idea how someone could have created such a trap.

But they clearly did.

Nice catch.


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.
MVand.3
Associate II

Thanks John, I appreciate the quick replies.