Skip to content

Instantly share code, notes, and snippets.

@mapmeld
Created August 5, 2012 02:40
Show Gist options
  • Save mapmeld/3261217 to your computer and use it in GitHub Desktop.
Save mapmeld/3261217 to your computer and use it in GitHub Desktop.
Server-Makes-Motor-Run
// CfA Liberty Bell Project
var http = require('http');
var five = require("johnny-five");
var board = new five.Board();
board.on("ready", function() {
http.createServer(function () {
console.log('Hey!');
var motor = new five.Led(2);
motor.on();
board.wait( 500, function(){
motor.off();
});
}).listen(process.env.PORT || 3000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment