Created
December 29, 2015 15:45
-
-
Save ghtomcat/44e1e6592cfbb5e3b3d6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 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