rust-mcp3208
is a library to read adc values from an MCP3208 via spi.
Cargo.toml
toml
[dependencies]
mcp3208 = "1.0.0"
```rust use mcp3208::{Mcp3208, Channel};
/// outputs the raw adc values of all channels fn main() { if let Ok(mut mcp3208) = Mcp3208::new("/dev/spidev0.0") { Channel::VALUES.iter().foreach(|&channel| { println!("channel #{}: {}", channel as u8, mcp3208.readadc_single(channel).unwrap()); }); } } ```