Built with 🦀
About
This library allows you control the state of code execution using blink(1) LED notifier.
You simply wrap the code you want to track with transition library:
use Error;
use thread;
use Duration;
use Transition;
What does it do?
- After calling
start()
, blink(1) starts blinking with blue light. This is done in a separate thread. - Then our code is executing.
- At the end we call
notification.notify_success()
(ornotification.notify_failure()
) which changes the color of LED to green (or red).
Supported colors:
use Led;
let color = Blue;
match color
See examples for more
Demo
Installation
Add as a dependency to your Cargo.toml
:
[]
= "0.1.1"
One of the dependency requires libusb-1.0
to be installed. On Linux you can install it by running:
Make sure that you have correct access rights to access blink(1) device. See udev rules here.
License
This project is licensed under either of
- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.