blinkstick-rs
blinkstick-rs provides an interface to control any BlinkStick device using Rust.
Examples
:exclamation: For the non-published updates, please refer to function documentation for the latest examples.
Sets the color of a single led to red
use ;
let blinkstick = new.unwrap;
blinkstick.set_led_color;
Sets a random color to every led on the BlinkStick device
use ;
let blinkstick = new.unwrap;
let mut colors: = blinkstick.get_color_vec;
for led in 0..blinkstick.max_leds as usize
blinkstick.set_all_leds_colors.unwrap;
Makes the 1st, 3rd, 5th LED blink 2 times, once every 200 milliseconds, with a yellow glow
use ;
let blinkstick = new.unwrap;
blinkstick.blink_multiple_leds_color.unwrap;
Makes every led pulse between being turned off and a green color
use ;
let blinkstick = new.unwrap;
let color = Color ;
blinkstick.pulse_all_leds_color.unwrap;
Makes the first led transform from a red color into a green color over a period of five seconds, with 50 color updates.
use ;
let blinkstick = new.unwrap;
blinkstick.set_led_color.unwrap;
blinkstick.transform_led_color.unwrap;
Running tests
Tests are only runnable when a BlinkStick device is plugged in. Furthermore, tests should be run using cargo test -- --test-threads=1
or they might fail.
Dependencies
Linux
- libusb - Can be installed using for example "apt install usbutils" or "yum install usbutils"