I was trying to set up an interrupt for when object comes into range and was getting false triggers when out of range or distant targets. I found the following and worked out what I believe is the issue
IntOnTarget is no longer used according to ST datasheet and user guide and should be set to 0 instead
Setting threshold and detection mode
In addition to the regular ranging features, the sensor also has the capability to detect a target with predefined
detection criteria. When the preconfigured criteria are matched the sensor raises an interrupt and returns the
distance.
Use the VL53L1X_ERROR VL53L1X_SetDistanceThreshold (dev, ThreshLow, ThreshHigh, Window,
IntOnNoTarget) to configure the detection criteria.
• ThreshLow is the low distance threshold in millimeters
• ThreshHigh is the high distance threshold in millimeters
• Window :
– Window = 0: Below a certain distance
◦ If object distance > ThreshLow or no object found: no report
◦ If object distance < ThreshLow and object found: report
– Window = 1: Beyond a certain distance
◦ If object distance < ThreshHigh or no object found: no report
◦ If object distance > ThreshHigh and object found: report
– Window = 2: Out of distance range (min/max), "out of Window"
◦ ThreshLow < object distance < ThreshHigh: no report
◦ ThreshLow > object distance > ThreshHigh: report
– Window = 3: Within the distance range (min/max), "inside Window"
◦ ThreshLow > object distance > ThreshHigh: no report
◦ ThreshLow < object distance < ThreshHigh: report
• **IntOnNoTarget is no longer used, set to 0**
To go back to the regular ranging mode, write 0x20 to the 0x46 register (8 bits)
I modified libary as follows and it resolved the issue and I am no longer getting false triggers:
I was trying to set up an interrupt for when object comes into range and was getting false triggers when out of range or distant targets. I found the following and worked out what I believe is the issue
Current Library:
IntOnTarget is no longer used according to ST datasheet and user guide and should be set to 0 instead
I modified libary as follows and it resolved the issue and I am no longer getting false triggers:
Hope this helps, if not could you explain why I noticed the behaviour for my own sanity more than anything else.