mirror of
https://codeberg.org/icewind/pms700x.git
synced 2026-06-03 18:14:11 +02:00
13 lines
360 B
Rust
13 lines
360 B
Rust
use linux_embedded_hal::Serial;
|
|
use nb::block;
|
|
use pms700x::Pms700X;
|
|
use std::env::args;
|
|
use std::path::PathBuf;
|
|
|
|
fn main() {
|
|
let port = args().skip(1).next().expect("No serial provided");
|
|
let serial = Serial::open(&PathBuf::from(port)).unwrap();
|
|
|
|
let mut pms = Pms700X::new(serial).into_active().unwrap();
|
|
dbg!(block!(pms.read()).unwrap());
|
|
}
|