How sparkfun/sparkfun_vl53l5cx_arduino_library works
This is an Arduino library for SparkFun’s VL53L5CX multizone time-of-flight sensor. Sketches configure the sensor and start ranging through the SparkFun API; the ST driver and platform layer communicate over I²C, and readings are exposed to the sketch. The repository also provides threshold, motion-indicator, and crosstalk features plus a Processing 3D depth-map application. The README documents up-to-8×8 ranging; that visualization’s connection to the library is not established by the sampled source.
Main entry points: vl53l5cx_api.cpp ST ranging API · SparkFun_VL53L5CX_Library.cpp SparkFun API · SparkFun_VL53L5CX_IO.cpp I²C transport · platform.cpp Platform adapter
Components 12
Arduino client
- Arduino sketch
examples/Example1_DistanceArray/Example1_DistanceArray.ino
Library interface
- SparkFun API
src/SparkFun_VL53L5CX_Library.cpp - API settings
src/SparkFun_VL53L5CX_Library_Constants.h
Sensor driver
- I²C transport
src/SparkFun_VL53L5CX_IO.cpp - Platform adapter
src/platform.cpp - ST ranging API
src/vl53l5cx_api.cpp - Firmware buffers
src/vl53l5cx_buffers.h
Ranging features
- Detection thresholds
src/vl53l5cx_plugin_detection_thresholds.cpp - Motion indicator
src/vl53l5cx_plugin_motion_indicator.cpp - Crosstalk calibration
src/vl53l5cx_plugin_xtalk.cpp
Depth visualization
- 3D depth map
processingApp/SparkFun_VL53L5CX_3D_Depth_Map/SparkFun_VL53L5CX_3D_Depth_Map.pde
Other components
- VL53L5CX sensor
Connections 11
- Arduino sketch → SparkFun API: configures and ranges
- SparkFun API → ST ranging API: calls ranging API
src/SparkFun_VL53L5CX_Library.cpp - SparkFun API → I²C transport: uses transport
src/SparkFun_VL53L5CX_Library.cpp - Platform adapter → I²C transport: adapts I²C
src/platform.cpp - ST ranging API → Platform adapter: reads and writes
- ST ranging API → Firmware buffers: uses buffers
src/vl53l5cx_api.cpp - I²C transport → VL53L5CX sensor: transfers registers
src/SparkFun_VL53L5CX_IO.cpp - Detection thresholds → ST ranging API: uses driver API
- Motion indicator → ST ranging API: uses driver API
- Crosstalk calibration → ST ranging API: uses driver API
src/vl53l5cx_plugin_xtalk.cpp - 3D depth map → VL53L5CX sensor: visualizes ranging