On Github mimming / internet-of-nodebots
Credit: http://xkcd.com/730/
$ npm install johnny-five
var five = require('johnny-five'); var board = new five.Board(); board.on('ready', function() { var led = new five.Led("13"); led.on(); });
var five = require('johnny-five'); var board = new five.Board(); board.on('ready', function() { var led = new five.Led("13"); var button = new five.Button("8"); button.on("up", function () { led.off(); }); button.on("down", function () { led.on(); }); });
var ref = new Firebase("https://io.firebaseio-demo.com/"); ref.set("Hello, Developers!");
ref.on("value", function (snapshot) { var data = snapshot.val(); console.log(data); });
var five = require('johnny-five'); var Firebase = require("firebase"); var board = new five.Board(); var firebaseRef = new Firebase("https://firebutton.firebaseio-demo.com/button"); board.on("ready", function () { var button = new five.Button(8); var led = new five.Led(13); button.on("up", function () { firebaseRef.set(false); }); button.on("down", function () { firebaseRef.set(true); }); firebaseRef.on("value", function (snapshot) { var buttonValue = snapshot.val(); if (buttonValue) { led.on(); setTimeout(function() { led.off(); }, 2500); } });});