Crates.io | ut181a |
lib.rs | ut181a |
version | 0.2.1 |
source | src |
created_at | 2017-11-11 08:06:19.341964 |
updated_at | 2017-12-29 08:34:03.463034 |
description | Uni-T UT181A DMM remote control |
homepage | |
repository | https://github.com/antage/ut181a |
max_upload_size | |
id | 38973 |
size | 61,521 |
Uni-T UT181A digital multimeter (DMM) remote control library. It supports USB connection only.
API documentation is here.
$ sudo apt-get install libudev-dev libhidapi-dev
$ cargo build
extern crate hid;
extern crate ut181a;
use ut181a::{Dmm, Measurement};
fn run() -> Result<(), ut181a::Error> {
let manager = hid::init()?;
for device in manager.find(Some(0x10C4), Some(0xEA80)) {
let mut dmm = Dmm::new(device.open()?)?;
dmm.monitor_on()?;
for _ in 1..10 {
let m: Measurement = dmm.get_measurement()?;
println!("{:?}", m);
}
dmm.monitor_off()?;
break;
}
Ok(())
}
fn main() {
match run() {
Err(err) => {
eprintln!("ERROR: {}", err);
}
_ => {}
}
}
This library licensed under the following: