Created
June 14, 2016 16:10
-
-
Save deathbearbrown/e33895235a93928075173c0dfa21a7ec 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 Tessel = require("tessel-io"); | |
var board = new five.Board({ | |
io: new Tessel() | |
}); | |
board.on("ready", function() { | |
var button = new five.Button({ | |
pin: "a0", | |
invert: true | |
}); | |
board.repl.inject({ | |
button: button | |
}); | |
button.on("hold", function() { | |
console.log( "Button held" ); | |
}); | |
button.on("press", function() { | |
console.log( "Button pressed" ); | |
}); | |
button.on("release", function() { | |
console.log( "Button released" ); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment