Skip to content

An API to connect to PCF8591 A/D and D/A converter

License

Notifications You must be signed in to change notification settings

tafia/pcf8591-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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));
}

About

An API to connect to PCF8591 A/D and D/A converter

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages