mirror of
https://codeberg.org/icewind/pms700x.git
synced 2026-06-03 18:14:11 +02:00
wip
This commit is contained in:
parent
25dc443d9a
commit
9058d7e068
6 changed files with 353 additions and 2 deletions
14
examples/wake.rs
Normal file
14
examples/wake.rs
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
use linux_embedded_hal::Serial;
|
||||
use nb::block;
|
||||
use pms700x::Pms700X;
|
||||
use pms700x::Sleep;
|
||||
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);
|
||||
block!(pms.set_sleeping(Sleep::Wakeup)).unwrap();
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue