pcf8591 0.1.1

A rust API for PCF8591 A/D converter
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented1 out of 8 items with examples
  • Size
  • Source code size: 17.01 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.24 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 23s Average build duration of successful builds.
  • all releases: 23s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • tafia/pcf8591-rs
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • tafia

pcf8591-rs

An API to connect to PCF8591 A/D converter.

Documentation

Example

use pcf8591::{PCF8591, Pin};
use std::thread;
use std::time::Duration;

// Gets default location on raspberry pi (rev 2)
let mut converter = PCF8591::new("/dev/i2c-1", 0x48, 3.3).unwrap();

loop {
    let v = converter.analog_read(Pin::AIN0).unwrap();
    println!("Input voltage at pin 0: {}", v);

    thread::sleep(Duration::from_millis(1000));
}