Crates.io | blinkrs |
lib.rs | blinkrs |
version | 2.0.1 |
source | src |
created_at | 2019-09-27 19:41:55.213742 |
updated_at | 2022-02-12 02:12:02.41679 |
description | A small api for interacting with blink(1) LED lights. |
homepage | https://github.com/dadleyy/blinkrs |
repository | https://github.com/dadleyy/blinkrs.git |
max_upload_size | |
id | 168195 |
size | 18,960 |
A rust cli tool for controlling the blink(1) USB LED light.
use std::boxed::Box;
use std::error::Error;
use blinkrs::{Blinkers, Message};
fn main() -> Result<(), Box<dyn Error>> {
let blinkers: Blinkers = match Blinkers::new() {
Ok(b) => b,
Err(_e) => {
println!("unable to find device");
return Ok(())
},
};
blinkers.send(Message::from("red"))?;
blinkers.send(Message::from("off"))?;
Ok(())
}
See CONTRIBUTING.