Skip to main content
MVand.3
Associate II
April 9, 2021
Solved

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

  • April 9, 2021
  • 2 replies
  • 1049 views
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?

This topic has been closed for replies.
Best answer by John E KVAM

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.

2 replies

John E KVAM
John E KVAMBest answer
ST Employee
April 9, 2021

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
MVand.3Author
Associate II
April 9, 2021

Thanks John, I appreciate the quick replies.