Skip to content
Control you lightpack directly without the Prismatik software using node and HID.
Branch: master
Clone or download
Pull request Compare This branch is even with tkhduracell:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
.editorconfig
.gitignore
.node-version
CONTRIBUTING.md
LICENSE.md
README.md
index.js
package-lock.json
package.json

README.md

node-lightpack-led

Control you lightpack directly without the Prismatik software using node and HID.

npm version

Getting started

npm install git+ssh://git@github.com: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 );
    });
You can’t perform that action at this time.