Crates.io | vl53l0x |
lib.rs | vl53l0x |
version | 1.0.1 |
source | src |
created_at | 2018-11-14 17:53:46.81185 |
updated_at | 2024-07-24 20:47:52.999553 |
description | A platform agnostic driver to interface with the vl53l0x (time-to-flight sensor) |
homepage | |
repository | https://github.com/copterust/vl53l0x |
max_upload_size | |
id | 96675 |
size | 42,734 |
vl53l0x
no_std driver for the vl53l0x vl53l0x (Time of Flight IR distance sensor).
VL53L0X
;
Include library as a dependency in your Cargo.toml :
[dependencies.vl53l0x]
version = "<version>"
Use embedded-hal implementation to get I2C handle and delay then create vl53l0x handle:
use vl53l0x;
// to create sensor with i2c:
let mut tof = vl53l0x::VL53L0x::new(i2c).expect("tof");
tof.set_measurement_timing_budget(200000).expect("time budget");
tof.start_continuous(0).expect("start");
let mls = tof.read_range_continuous_millimeters();
println!("{}", mls);
Number of examples can be found in proving-ground repo.
https://github.com/ChocolateLoverRaj/rust-esp32c3-examples/tree/main/VL53L0X
API Docs available on docs.rs.
Licensed under either of
at your option.