I have a working sketch using the Fast Ranging (100Hz) setup shown in ST App Note AN5263. The application also requires a maximum threshold distance which I am attempting to set using VL53L1_SetThresholdConfig(Dev, detectionConfig);.
Can you provide some guidance on the correct C++ syntax for listing the parameters:
cannot convert ‘VL53L1_DetectionConfig_t’ to ‘VL53L1_DetectionConfig_t*’ for argument ‘2’ to ‘VL53L1_Error VL53L1_SetThresholdConfig(VL53L1_DEV, VL53L1_DetectionConfig_t*)’
I have some additional questions regarding my implementation which uses multiple VL53L1X sensors used simply as proximity sensors. I don’t need to know the distance, just need the interrupt to trigger and the ISR records the elapsed time using millis(). Each sensor should continuously range and when an object is detected in the threshold I want to read the interrupt. I’m using I2C to set addresses and to clear the sensor interrupt.
I have a sketch functioning (modified the provided example sketch) using a single sensor where I can change the address. The following function:
status = VL53L1_WaitMeasurementDataReady(Dev);
works but seems to have a timeout. I don’t want a timeout. Is this the best function to use?
All of the information we have about ST’s VL53L1X API comes from the documentation that they provide, and our work with it has generally been limited to writing the Arduino platform layer and verifying that it works properly, so for any in-depth questions about the API functions, you would probably be better off trying to contact ST directly. You might try posting your question on their community site.
Can you provide some guidance on how to handle the threshold settings for multiple sensor objects? Ideally I would like to provide a different threshold low distance for each sensor.
The sensors have some variation in the threshold distance so it would be useful to be able to have a different distance quantity for each. I tried putting each sensor setup in a function with the dedicated structure:
We have not really done much with thresholds in the API, so I don’t think we have any particular advice to offer. One troubleshooting step you could try is looking at the actual distance readings reported by the sensors to see if they are what you expect (that would tell you whether the distances themselves seem wrong or the threshold configuration doesn’t seem to be working as intended).
Otherwise, for issues that are not specific to our VL53L1X carrier board, ST should be better able to help you with the API and the VL53L1X sensor itself.