Skip to content

Instantly share code, notes, and snippets.

@ismailuddin
Last active September 5, 2015 06:15
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 ismailuddin/496dc82cabdab1c4ba92 to your computer and use it in GitHub Desktop.
Save ismailuddin/496dc82cabdab1c4ba92 to your computer and use it in GitHub Desktop.
Johnny-Five / Node-pixel test
pixel = require("node-pixel");
five = require("johnny-five");
var board = new five.Board();
var randomColor = function (low, high) {
return Math.floor(Math.random() * (high - low) + low);
}
board.on("ready", function() {
console.log("Board initialised")
var strip = new pixel.Strip({
data: 6,
length: 12,
board: this,
controller: "FIRMATA",
});
strip.on("ready", function() {
// do stuff with the strip here.
console.log("Pixels about to light up")
strip.show();
for (i = 0; i < strip.stripLength(); i++) {
console.log(i);
strip.pixel(i).color("teal");
}
strip.show();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment