Skip to main content
John E KVAM
ST Employee
June 16, 2022
Solved

Customer asks, "I am using VL53L1X , code works fine when there is obstacle in the range of 0 to 4 meter ,if no obstacle above 4 meter sensor is giving random values , how we can fix this issue?"

  • June 16, 2022
  • 1 reply
  • 1350 views

..

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

There is a Range Status that you can read from the sensor. It will tell you what happened. But basically if you don't get a '0' status, something went wrong and you cannot use the result.

This 'Range Status' is not the result of your function. Your 'read_result' function worked just fine. This is a register returned by the sensor giving you the hardware status.

With no object, no photons will be returned, and your Range Status will return a 'no signal' status.

but there are other conditions you should look for.

(Generally the Range Result will be 8192 minus the status, but don't count on it. Check the Range Status.

1 reply

John E KVAM
John E KVAMAuthorBest answer
ST Employee
June 16, 2022

There is a Range Status that you can read from the sensor. It will tell you what happened. But basically if you don't get a '0' status, something went wrong and you cannot use the result.

This 'Range Status' is not the result of your function. Your 'read_result' function worked just fine. This is a register returned by the sensor giving you the hardware status.

With no object, no photons will be returned, and your Range Status will return a 'no signal' status.

but there are other conditions you should look for.

(Generally the Range Result will be 8192 minus the status, but don't count on it. Check the Range Status.