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!

22 lines (17 loc) 420 B
var five = require("../lib/johnny-five.js"), board, slider, servo, scalingRange; board = new five.Board(); board.on("ready", function() { slider = new five.Sensor({ pin: "A0", freq: 50 }); // log out the slider values to the console. slider.on("slide", function(err, value) { if (err) { console.log("error: ", err); } else { console.log(Math.floor(this.value)); } }); });