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, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!

15 lines (11 loc) 266 B
var five = require("../lib/johnny-five"); var board = new five.Board(); board.on("ready", function() { var encoder = new five.Encoder({ pins: [ 12, 11 ], positions: 24, }); encoder.on("change", function() { console.log(this.position); }); });