bf5ee0ec78
Signed-off-by: Thomas Klaehn <thomas.klaehn@perinet.io>
11 lines
277 B
Rust
11 lines
277 B
Rust
use ina3221;
|
|
|
|
fn main() {
|
|
let mut ina = ina3221::Ina3221::new(0x40);
|
|
let res = match ina.current(ina3221::Channel::One) {
|
|
Ok(value) => value,
|
|
Err(error) => panic!("Can't read i2c: {error:?}"),
|
|
};
|
|
println!("Channel one current: {:?} mA", res);
|
|
}
|