node-lightpack-led

1.1.1 • Public • Published

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 );
    });

Package Sidebar

Install

npm i node-lightpack-led

Weekly Downloads

0

Version

1.1.1

License

Apache-2.0

Unpacked Size

17.8 kB

Total Files

4

Last publish

Collaborators

  • tkhduracell