A translation of Pololu's VL53L1X Arduino Library for Raspberry Pi Pico using the Pico SDK. Provides a basic I2C interface for ST's VL53L1X time-of-flight distance sensor.
- Download the library directory.
- Place it in your project's
lib
folder. - Add to your
CMakeLists.txt
:
add_subdirectory(lib/vl53l1x-pico)
target_link_libraries(your_target VL53L1X)
To add this library as a Git submodule, run:
git submodule add https://github.com/x33025/vl53l1x-pico.git lib/vl53l1x-pico
git submodule update --init --recursive
In your CMakeLists.txt
:
add_subdirectory(lib/vl53l1x-pico)
target_link_libraries(your_target VL53L1X)
If you are cloning a project that includes this as a submodule, use:
git clone --recurse-submodules https://github.com/yourproject/repository.git
To update submodules:
git submodule update --remote --merge
The library requires these Pico SDK components:
# In your project's CMakeLists.txt:
target_link_libraries(your_target
pico_stdlib
hardware_i2c
VL53L1X
)
- Basic ranging measurements
- Timing budget configuration
- Distance mode selection (Short/Medium/Long)
- Timeout handling
- Continuous & single-shot modes
Most functionality matches the original Arduino library. For a detailed API reference, see Pololu's Documentation.
- Raspberry Pi Pico SDK
hardware_i2c
(from Pico SDK)