#embedded-hal #vl53l1x #no-alloc #no-std

无std vl53l1x-simple

A Rust driver for the VL53l1X TOF ranging sensor

2不稳定版本

0.2.0 2024年7月31日
0.1.1 2024年7月15日
0.1.0 2024年7月15日

#257 in 嵌入式开发

Download history 225/week @ 2024-07-14 149/week @ 2024-07-28 3/week @ 2024-08-04

每月377次下载

MIT/Apache

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