2025-03-22 7:36 AM
Hello,
Apologies in advance for the length of this post.
I am looking for some advice as I am working on getting a cpp based callback for the VL53L4CD sensor, to do this I have written a file which should perform all the same setup as the driver provided however I am encountering a strange error that I cannot understand.
Link to Github with Code, please see VL53L4CD_API for all relevant codde
When I run my own file first, it sets the sensor to always return a status of two even if I then run the example executable (menu) provided as part of the the driver example this also returns a status of two.
HOWEVER, if I run these in the other order the sensor range is printed perfectly by my own program. This status will remain the same for any executable ran after the first and will be overwritten.
I have tried to find a conditional statement that might cause this however I have been unsuccessful in doing so and would appreciate any assistance provided.
As a side note, I have tried adding in the set range timing which is missing from the current code however, this does not solve the issue.
Thanks in advance for any help you can provide and feel free to ask for any further clarification.
Regards,
BruGenie