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!

17 lines (13 loc) 350 B
var Barcli = require("barcli"); var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var sensor = new five.Sensor("A0"); var graph = new Barcli({ label: "Sensor", range: [0, 100] }); sensor.scale([0, 100]).on("change", function() { graph.update(this.value >>> 0); }); });