Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tafia/pcf8591-rs
An API to connect to PCF8591 A/D and D/A converter
https://github.com/tafia/pcf8591-rs
converter pcf8591 raspberry-pi rust
Last synced: 4 days ago
JSON representation
An API to connect to PCF8591 A/D and D/A converter
- Host: GitHub
- URL: https://github.com/tafia/pcf8591-rs
- Owner: tafia
- License: mit
- Created: 2016-11-30T07:56:58.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2016-12-02T02:52:29.000Z (about 8 years ago)
- Last Synced: 2024-11-15T02:59:28.424Z (about 1 month ago)
- Topics: converter, pcf8591, raspberry-pi, rust
- Language: Rust
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-MIT.md
Awesome Lists containing this project
README
# pcf8591-rs
An API to connect to PCF8591 A/D converter.
[Documentation](https://docs.rs/pcf8591-rs)
## Example
```rust
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));
}
```