Skip to main content
TPhil.3
Associate
September 24, 2021
Solved

VL53L5CX: Conflicting comments in ULD API and single 4x4 threshold

  • September 24, 2021
  • 2 replies
  • 935 views

Greetings - within the "Example_9_detection_thresholds.c" , there a comment (line 164) stating:

"... Please note that the

first one must always be set with a mathematic_operation

VL53L5CX_OPERATION_NONE...."

Yet, within "vl53l5cx_plugin_detection_thresholds.h" it states (line 120):

"...Please note that the first checker MUST always be a OR

operation...."

Base on the example code is working, I assume the first is correct?

Q2 - Single 4x4 threshold: To validate what I'm testing is correct, for single a 4x4 threshold would look something like this:

 for (uint8_t i = 0; i < 16; i++) {

    thresholds[i].zone_num = i;

    thresholds[i].measurement = VL53L5CX_DISTANCE_MM;

    thresholds[i].type = VL53L5CX_IN_WINDOW;

    thresholds[i].mathematic_operation = VL53L5CX_OPERATION_NONE;

    thresholds[i].param_low_thresh = 400;

    thresholds[i].param_high_thresh = 800;

 }

 thresholds[15].zone_num = VL53L5CX_LAST_THRESHOLD | thresholds[15].zone_num;

TIA,

-Terry

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

Turns out the OR and the NONE are both defined as '0', so both are correct and it is the documentation that is confusing.

Thanks for the post.

I'll get someone to update the documentation.

  • john

2 replies

John E KVAM
John E KVAMBest answer
ST Employee
October 11, 2021

Turns out the OR and the NONE are both defined as '0', so both are correct and it is the documentation that is confusing.

Thanks for the post.

I'll get someone to update the documentation.

  • john
TPhil.3
TPhil.3Author
Associate
October 11, 2021

Thank you for the clarification!

-Terry