A Java library to control Digistump ATTiny85-based BlinkStick devices via USB to set a LED color or execute a color pattern directly on the Digistump.
- Uses
org.hid4java.HidDevice
instead ofcom.codeminders.hidapi
- Includes effects like cross-fade and strobe
- Has support for uploading a color pattern when using the color-patten firmware fork
- Has try-with-resources support to close the USB properly
See the examples
folder for several examples setting colors and patterns.
Here is a device with the color-pattern-buffer firmware with which to use this Java API.
This is helpful:
# Install libudev and libusb-1.0
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libudev-dev libusb-1.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Link libudev.so.1 to libudev.so.0
RUN ln -sf $(find /lib -name libudev.so) $(find /lib -name libudev.so).0
Run docker run --device=/dev/bus ...
to mount the USB devices.
The API is based on the the BlinkStick Android and BlinkStick for Processing libraries by arvydas.
Part of this fork is based off the fork from Flewp/blinkstick-java which adds a rate limiter when communicating with the WS2812. This version works well on Windows 10.