#sensor #accessing #serial #bus #co₂

bin+lib mhz19

Accessing MH-Z19 CO₂ sensor over serial bus

1 unstable release

0.1.0 Sep 5, 2019

#59 in #accessing

MIT/Apache

9KB
114 lines

MH-Z19-rs

Accessing MH-Z19 CO₂ sensor over serial bus using rust

Usage

use mhz19::MHZ19;

fn main() {
    let mut mhz19 = MHZ19::open("/dev/ttyUSB0").unwrap();
    println!("CO₂ readout: {} ppm", mhz19.read().unwrap());
}

Dependencies

~2MB
~42K SLoC