This library lets you control a Blync (RGB led for USB).
We use the NPM module node-hid
which has a few dependencies:
sudo apt-get install libudev-dev libusb-1.0-0-dev
npm install blync
// TODO
var blync = require('blync');
// How many Blyncs are hooked up?
var deviceCount = blync.getDevices().length;
var device = blync.getDevice(0);
// Make Blync light up in red
device.setColor('red');
// Make Blync blink in blue for 250 milliseconds
device.blinkColor('blue', 250);
// Turn Blync off when you exit
process.on( 'SIGINT', function() {
device.turnOff();
process.exit(0);
});