Blinky is a Java wrapper around Blink(1). It was initially written to manage Blink(1) USB operations programmatically.
<dependency>
<groupId>com.skylarwatson</groupId>
<artifactId>blinky</artifactId>
<version>1.2.1</version>
</dependency>
First initialize your blinky project
public class Main {
public static void main(String[] args) {
new BlinkApplicationRunner().run();
}
}
Next, you'll want to create a blink rule
@Blinker
public class BlinkDemo implements BlinkRule {
@Override
public boolean illuminate() {
return true;
}
}
If illuminate()
returns true
blink(1) USB will turn red
To change the led color supply an RGB value to the @Blinker
annotation.
@Blinker(color = RGB.GREEN)
You can select which led to enable by providing a LED
value to the @Blinker
annotation
@Blinker(led = LED.TOP)