openpixelcontrol-stream
stream-based implementation of the openpixelcontrol-protocol. Provides a protocol-parser and a client-implementation.
installation
npm install openpixelcontrol-stream
usage example
openpixelcontrol server
This will run an openpixelcontrol server on the default port (7890) and send
received data to the rpi-ws281x-native
module for output to a strip of
ws2812-leds.
var ParseStream = OpcParseStream net = ws281x = ; var server = net; ws281x;server;
openpixelcontrol client
A basic client connecting to an openpixelcontrol-server and running an animation there.
var ClientStream = OpcClientStream net = ; var NUM_LEDS = 100 OPC_CHANNEL = 0; var client = ; // connect to openpixelcontrol-server at `192.168.1.42:7890`var socket = net; { // create a typed-array for color-data var data = NUM_LEDS; // setup an animation-loop at 10FPS ;}