A Rust driver for the VL53L0X TOF ranging sensor.
Find a file
2024-07-31 16:19:01 +12:00
src Use eh delay for timeouts 2024-07-16 18:36:13 +12:00
.gitignore Upload initial version 2024-07-15 18:03:50 +12:00
Cargo.lock Increment version 2024-07-31 16:19:01 +12:00
Cargo.toml Increment version 2024-07-31 16:19:01 +12:00
LICENSE-APACHE Upload initial version 2024-07-15 18:03:50 +12:00
LICENSE-MIT Upload initial version 2024-07-15 18:03:50 +12:00
README.md Upload initial version 2024-07-15 18:03:50 +12:00

A simple Rust driver for the VL53l0X TOF ranging sensor.

This crate is intentionally basic and does not implement all the features of the VL53l0X. It is designed to be a simple way to get distance readings from the sensor. PRs are welcome if you would like to add more features.

The overall architecture of this crate is based on the original C code and the Polulu Arduino library, but the interface has been greatly simplified and Rust-ified.

Usage

let mut tof = Vl53l0x::new(i2c, x_shut, 0x31, &clock_source).unwrap();

loop {
    if let Some(reading) = tof.try_read().unwrap() {
        println!("Distance: {}mm", reading);
    }
}