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!

14 lines (10 loc) 328 B
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var slider = new five.Sensor("A0"); var led = new five.Led(11); // Scale the sensor's value to the LED's brightness range slider.scale([0, 255]).on("data", function() { led.brightness(this.value); }); });