Created
July 6, 2013 02:57
-
-
Save creationix/5938450 to your computer and use it in GitHub Desktop.
Talking to tinyduino over firmatta using johnny-five.
This file contains 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
var five = require('johnny-five'); | |
var board = new five.Board(); | |
board.on("ready", function () { | |
var leds = new Array(5); | |
for (var i = 0; i < 5; i++) { | |
leds[i] = new five.Led({pin: i + 5}); | |
} | |
setInterval(function () { | |
for (var i = 0; i < 5; i++) { | |
var on = Math.random() > 0.5; | |
leds[i][on ? "on" : "off"](); | |
} | |
}, 33); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Video at https://www.youtube.com/watch?v=F_orLdWliQI