UNPKG

johnny-five

Version:

The JavaScript Robotics and Hardware Programming Framework. Use with: Arduino (all models), Electric Imp, Beagle Bone, Intel Galileo & Edison, Linino One, Pinoccio, Raspberry Pi, Spark Core, TI Launchpad and more!

18 lines (15 loc) 458 B
var five = require("../lib/johnny-five.js"); new five.Board().on("ready", function() { // Attaching to an O* pin in a deviation from // TinkerKit tutorials which instruct to attach // the touch to an I* pin. // // For the "touch" module, simply use a Button // instance, like this: var touch = new five.Button("O5"); ["down", "up", "hold"].forEach(function(type) { touch.on(type, function() { console.log(type); }); }); });