color-strip
v1.0.0
Published
Node.js interface to control the adafruit [RGB LED strip](https://www.adafruit.com/products/306).
Downloads
4
Readme
Color Strip
Node.js interface to control the adafruit RGB LED strip.
Installation
Install node.js on your rasberry pi (I recommend using nvm)
Install this package:
npm install color-strip
Enable spi manually or using raspi-config (the option to enable spi is under "Advanced Options").
Useage
var ColorStrip = require('color-strip');
var strip = new ColorStrip({
device: '/dev/spidev0.0',
numberLEDs: 32
});
// set led 0 to white, led 1 to red, led 2 to green, and led 3 to blue
strip.setColor(0, 127, 127, 127)
strip.setColor(1, 127, 0, 0)
strip.setColor(2, 0, 127, 0)
strip.setColor(3, 0, 0, 127)
// flush the colors to the strip
strip.transfer()
// or use the hex interface
strip.setColorFromRGBHex(0, '#43BFCE')
strip.transfer()