mirror of
https://codeberg.org/icewind/pms700x.git
synced 2026-06-03 10:04:13 +02:00
wip
This commit is contained in:
parent
25dc443d9a
commit
9058d7e068
6 changed files with 353 additions and 2 deletions
13
examples/active_read.rs
Normal file
13
examples/active_read.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
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());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue