2025-01-14 14:42:18 +01:00
|
|
|
use ina3221;
|
|
|
|
|
|
|
|
fn main() {
|
2025-01-16 13:29:25 +01:00
|
|
|
let mut ina = ina3221::Ina3221::new(0x40, "/dev/i2c-1", 5.0);
|
2025-01-14 14:42:18 +01:00
|
|
|
let res = match ina.current(ina3221::Channel::One) {
|
|
|
|
Ok(value) => value,
|
|
|
|
Err(error) => panic!("Can't read i2c: {error:?}"),
|
|
|
|
};
|
2025-01-16 13:29:25 +01:00
|
|
|
println!("Channel one current: {:?} A", res);
|
2025-01-14 14:42:18 +01:00
|
|
|
}
|