Crates.io | vl53l1x-simple |
lib.rs | vl53l1x-simple |
version | 0.2.0 |
source | src |
created_at | 2024-07-15 05:59:46.862838 |
updated_at | 2024-07-31 04:22:45.012735 |
description | A Rust driver for the VL53l1X TOF ranging sensor. |
homepage | https://github.com/NZRosto/vl53l1x-simple |
repository | https://github.com/NZRosto/vl53l1x-simple |
max_upload_size | |
id | 1303513 |
size | 52,622 |
A simple Rust driver for the VL53l1X TOF ranging sensor.
This crate is intentionally basic and does not implement all the features of the VL53l1X. 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.
let mut tof = Vl53l1x::new(i2c, x_shut, 0x30, &clock_source).unwrap();
loop {
if let Some(reading) = tof.try_read().unwrap() {
println!("Distance: {}mm", reading);
}
}