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!

15 lines (10 loc) 240 B
var five = require("../"); var board = new five.Board(); board.on("ready", function() { var proximity = new five.Proximity({ controller: "SRF10" }); proximity.on("data", function() { console.log(this.cm + "cm"); }); });