BlinkStick Node provides an interface to control Blinkstick devices connected to your computer with Node.js.
What is BlinkStick? It's a smart USB-controlled LED device. More info about it here:
- Node.js
- Libusb for Mac OSX and Linux
Install Node with npm and libusb using homebrew:
$> brew install node
$> brew install libusb
Install Node for Windows and make sure it's added to your PATH environment variable.
$> sudo apt-get install libusb nodejs npm
For the most up to date version of Node.js, use Node Version Manager.
$> nvm install --lts
Install libudev
and libusb
development packages:
$> sudo apt-get install libusb-1.0-0-dev libudev-dev -y
Install using npm:
$> npm install blinkstick
var blinkstick = require('blinkstick');
To get the first blinkstick on your system:
var device = blinkstick.findFirst();
To set the color:
led.blink('random', function(){
led.pulse('random', function(){
led.setColor('red', function(){
});
});
});
More details and examples available in the wiki:
https://github.com/arvydas/blinkstick-node/wiki
If you get an error message on Linux:
Error: cannot open device with path /dev/hidraw0
Please run the following command and restart your computer:
echo "KERNEL==\"hidraw*\", SUBSYSTEM==\"hidraw\", ATTRS{idVendor}==\"20a0\", ATTRS{idProduct}==\"41e5\", MODE=\"0666\"" | sudo tee /etc/udev/rules.d/85-blinkstick-hid.rules
- Arvydas Juskevicius - http://twitter.com/arvydev
- Paul Cuthbertson - http://twitter.com/paulcuth
Copyright (c) 2014 Agile Innovative Ltd and contributors
Released under MIT license.