1.1.1 • Published 5 years ago

node-lightpack-led v1.1.1

Weekly downloads
4
License
Apache-2.0
Repository
github
Last release
5 years ago

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

5 years ago

1.1.0

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago