led-com-node
v1.0.0
Published
Client for controlling ARGB Led Strip with led-com rgb controller
Readme
Firmware for ESP32 https://github.com/s256v/led-com
Usage example:
import {LedStrip, Colors, TimeUtils, RGBColor, HSVColor} from 'led-com-node'
const LED_COUNT = 99;
let ledStrip = new LedStrip(LED_COUNT, "COM5");
await ledStrip.start();
// predefined colors
await ledStrip.setSameColor(Colors.WHITE);
await TimeUtils.sleep(200);
await ledStrip.setSameColor(Colors.RED);
await TimeUtils.sleep(200);
// custom rgb color
await ledStrip.setSameColor(new RGBColor(0, 100, 0));
await TimeUtils.sleep(200);
await ledStrip.setSameColor(Colors.BLACK);
// hsv color
let step = 359 / (LED_COUNT - 1);
for (let i = 0; i < LED_COUNT; i++) {
ledStrip.setLedColor(i, new HSVColor(i * step, 100, 100));
await TimeUtils.sleep(50);
}
await ledStrip.stop();