3 unstable releases

Uses old Rust 2015

0.2.1 Dec 29, 2017
0.2.0 Dec 28, 2017
0.1.0 Nov 11, 2017

#855 in Hardware support

50 downloads per month
Used in ut181a-cli

MIT license

61KB
1.5K SLoC

ut181a

Documentation License: MIT Build Status

Uni-T UT181A digital multimeter (DMM) remote control library. It supports USB connection only.

Documentation

API documentation is here.

Building

Linux

$ sudo apt-get install libudev-dev libhidapi-dev
$ cargo build

Usage

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);
        }
        _ => {}
    }
}

License

This library licensed under the following:

Dependencies

~6MB
~107K SLoC