vl53l0x-simple

Crates.iovl53l0x-simple
lib.rsvl53l0x-simple
version0.2.0
sourcesrc
created_at2024-07-15 06:05:24.879618
updated_at2024-07-31 04:21:15.720079
descriptionA Rust driver for the VL53l0X TOF ranging sensor.
homepagehttps://github.com/NZRosto/vl53l0x-simple
repositoryhttps://github.com/NZRosto/vl53l0x-simple
max_upload_size
id1303517
size48,127
Reed Smout (NZRosto)

documentation

README

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);
    }
}
Commit count: 0

cargo fmt