Skip to content

Instantly share code, notes, and snippets.

@evilpacket
Created July 5, 2013 22:10
Show Gist options
  • Select an option

  • Save evilpacket/5937565 to your computer and use it in GitHub Desktop.

Select an option

Save evilpacket/5937565 to your computer and use it in GitHub Desktop.
var five = require("johnny-five"),
board;
var keypress = require('keypress');
board = new five.Board();
board.on("ready", function() {
console.log( "Ready event. Repl instance auto-initialized" );
var servo = new five.Servo(10)
this.repl.inject({
five: five,
servo: servo
});
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.setRawMode(true);
keypress(process.stdin);
process.stdin.on('keypress', function (ch, key) {
if (key && key.name == 'up') {
}
if (key && key.name == 'down') {
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment