#sensor #spi #driver #linux

mcp3008

Rust版的MCP3008传感器驱动程序

1个稳定版本

使用旧的Rust 2015

1.0.0 2018年2月8日

硬件支持中排名第1806

Download history 22/week @ 2024-03-11 12/week @ 2024-03-18 13/week @ 2024-03-25 42/week @ 2024-04-01 7/week @ 2024-04-08 9/week @ 2024-04-15 11/week @ 2024-04-22 4/week @ 2024-04-29 14/week @ 2024-05-06 15/week @ 2024-05-13 18/week @ 2024-05-20 13/week @ 2024-05-27 20/week @ 2024-06-03 17/week @ 2024-06-10 13/week @ 2024-06-17 9/week @ 2024-06-24

每月下载量61

MIT许可证

8KB
119

rust-mcp3008

MCP3008模数转换器

rust-mcp3008是用Rust重写的Adafruit_Python_MCP3008 Python库。

用法

Cargo.toml
[dependencies]
mcp3008 = "1.0.0"

extern crate mcp3008;

use mcp3008::Mcp3008;

fn main() {
    if let Ok(mut mcp3008) = Mcp3008::new("/dev/spidev0.0") {
        println!("{}", mcp3008.read_adc(0).unwrap());
    }
}

lib.rs:

rust-mcp3008是用Rust重写的Adafruit_Python_MCP3008 Python库。

依赖关系

~0–260KB