Skip to content

Instantly share code, notes, and snippets.

@meaku
Created July 24, 2018 09:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save meaku/026b410762528547522339f8adfda843 to your computer and use it in GitHub Desktop.
Save meaku/026b410762528547522339f8adfda843 to your computer and use it in GitHub Desktop.
//PIN 12 (BCM18)
const ws281x = require("rpi-ws281x-native");
const numLeds = 10;
ws281x.init(numLeds);
let pixelData = new Uint32Array(numLeds);
pixelData = [
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0],
[255,0,0]
];
ws281x.render(pixelData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment