vl53l0x-simple 0.2.0

A Rust driver for the VL53l0X TOF ranging sensor.
Documentation
  • Coverage
  • 100%
    12 out of 12 items documented1 out of 5 items with examples
  • Size
  • Source code size: 48.12 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 311.69 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • reed-smout/vl53l0x-simple
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • reed-smout

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);
    }
}