WebThing to control a strip of Sk6812 LEDs from a Raspberry Pi.
A WebThings Thing for controlling a strip of SK6812 RGBW LEDs from a Raspberry Pi.
This script relies on the rpi-ws281x NPM module, which does not currently support the SK6812.
Until this pull request is approved, you will need to manually download this forked copy of the rpi-ws281x module.
Run the following commands from one level above.
```
$ git clone https://github.com/AlanDThiessen/rpi-ws281x.git
$ cd rpi-ws281x
$ git checkout sk6812
``
$ npm install webthing-sk6812
Modify the parameters of the config object in index.js to match the hardware configuration.
- numLeds: The total number of LEDs connected to the Raspberry Pi.gpio
- : The GPIO line to use to control the LEDs (default is PWM GPI 18).dma
- : The GMA channel to use.
- Default is 10.
- This may need to be changed if running on a Raspberry Pi 3 or later.
Root/sudo privileges are required to write to PWM GPI line on a Raspberry Pi.
Start the following command on the Raspberry Pi.
``
$ sudo node ./index.js
1. Use the WebThings Gateway to control this device.
2. Ensure the Web Thing Adapter is installed.
3. On the Things screen, click the + button to search and add devices. It should find the device SK6812`.