mcp3208 0.1.0

A MCP3208 sensor driver for Rust.
Documentation
  • Coverage
  • 27.27%
    6 out of 22 items documented0 out of 7 items with examples
  • Size
  • Source code size: 15.98 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.98 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 15s Average build duration of successful builds.
  • all releases: 15s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • kawogi/rust-mcp3208
    2 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • kawogi

rust-mcp3208

MCP3208 A/D converter

rust-mcp3208 is a library to read adc values from an MCP3208 via spi.

Usage

[dependencies]
mcp3208 = "1.0.0"
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().for_each(|&channel| {
            println!("channel #{}: {}", channel as u8, mcp3208.read_adc_single(channel).unwrap());
        });
    }
}