2不稳定版本
0.2.0 | 2024年7月31日 |
---|---|
0.1.1 | 2024年7月15日 |
0.1.0 |
|
#257 in 嵌入式开发
每月377次下载
41KB
664 行
一个简单的VL53l1X TOF测距传感器的Rust驱动程序。
这个crate故意保持简单,并不实现VL53l1X的所有功能。它旨在提供从传感器获取距离读数的一种简单方式。如果您想添加更多功能,欢迎提交PR。
该crate的整体架构基于原始的C代码和Pololu Arduino库,但接口已被大大简化并Rust化。
用法
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);
}
}
依赖项
~56KB