Skip to content

VL53L0X — quick distance [mm] (non-blocking) (vl53l0x_fast_dist_mm)

What it does: Returns the non-blocking distance value from VL53L0X in millimeters (read_non_blocking).

vl53l0x_fast_dist_mm

Inputs

  • Field ID: selection of initialized rangefinder instance.

Output

  • Number: distance in mm (may be the last available value if the sensor has not yet completed a new measurement).

When to use it

  • In fast loops where you don't want to block the program by waiting for a new measurement.
  • For continuous control with less delay.

Tips and pitfalls

  • It does not wait for a new measurement, so it can return an older sample.
  • To validate the state of the scene, combine with a filter and a check of step changes.

Usage example

example_vl53l0x

Open example in ESP IDE

Generated Python example

value = tof1.read_non_blocking()