Skip to content

Instantly share code, notes, and snippets.

@ghtomcat
Created December 29, 2015 15:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ghtomcat/44e1e6592cfbb5e3b3d6 to your computer and use it in GitHub Desktop.
Save ghtomcat/44e1e6592cfbb5e3b3d6 to your computer and use it in GitHub Desktop.
var five = require('johnny-five');
var keypress = require('keypress');
var board = new five.Board({port:"/dev/tty/AdafruitEZ-Link6b34-SPP"});
board.on('ready', function() {
console.log('Welcome to Sumobot!');
console.log('Control the bot with the arrow keys, and SPACE to stop.');
var servoL = new five.Servo.Continuous(9);
var servoR = new five.Servo.Continuous(10);
keypress(process.stdin);
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.setRawMode(true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment