node-lightpack-led
v1.1.1
Published
Control you lightpack directly without the Prismatik software.
Downloads
3
Maintainers
Readme
node-lightpack-led
Control you lightpack directly without the Prismatik software using node and HID.
Getting started
npm install git+ssh://[email protected]:tkhduracell/node-lightpack-led.git --save
Usage
Get devices
const lp = require('node-lightpack-led');
console.log(lp.getDevices());
Returns a list of devices.
[
{
version: "7.5",
leds: 10,
id: "95230303231351210201",
manufacturer: "lightpack.googlecode.com",
product: "Lightpack",
setColor: function(color: color-struct, debug: bool) { ... },
setColorRGB: function(r: int, g: int, b: int, debug: bool) { ... },
enable: function(debug: bool) { ... },
disable: function(debug: bool) { ... },
write: function(data: int[65]) { ... }
}
]
Set color of leds to red
const lp = require('node-lightpack-led');
lp.getDevices().forEach(function(device) {
device.setColorRGB(255, 0, 0);
});
Address leds individually
const lp = require('node-lightpack-led');
const colors = [
{ r: 255, g: 0, b: 0 },
{ r: 255, g: 0, b: 0 },
{ r: 255, g: 0, b: 0 }
]
lp.getDevices().forEach(function(device) {
const debug = false // No debug prints
const repeatLast = false // Set this to true to repeat the last color instead of the entire array
device.setColorArray(colors, repeatLast, debug );
});