Last active
September 5, 2015 06:15
-
-
Save ismailuddin/496dc82cabdab1c4ba92 to your computer and use it in GitHub Desktop.
Johnny-Five / Node-pixel test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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