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.


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'

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.


Our community relies on fruitful exchanges and good quality content. You can thank and reward helpful and positive contributions by marking them as 'Accept as Solution'. When marking a solution, make sure it answers your original question or issue that you raised.

ST Employees that act as moderators have the right to accept the solution, judging by their expertise. This helps other community members identify useful discussions and refrain from raising the same question. If you notice any false behavior or abuse of the action, do not hesitate to 'Report Inappropriate Content'
MVand.3
Associate II

Thanks John, I appreciate the quick replies.