Crates.io | mcp3008 |
lib.rs | mcp3008 |
version | 1.0.0 |
source | src |
created_at | 2018-02-08 17:17:13.851767 |
updated_at | 2018-02-08 17:17:13.851767 |
description | A MCP3008 sensor driver for Rust. |
homepage | |
repository | https://github.com/PhilipTrauner/rust-mcp3008 |
max_upload_size | |
id | 50216 |
size | 7,717 |
MCP3008 A/D converter
rust-mcp3008
is a rewrite of the excellent Adafruit_Python_MCP3008 Python library in Rust.
[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());
}
}