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!

21 lines (17 loc) 607 B
var five = require("../lib/johnny-five.js"); var board = new five.Board(); board.on("ready", function() { var temperature = new five.Temperature({ controller: "MPL115A2" }); temperature.on("data", function() { console.log("temperature"); console.log(" celsius : ", this.celsius); console.log(" fahrenheit : ", this.fahrenheit); console.log(" kelvin : ", this.kelvin); console.log("--------------------------------------"); }); }); // @markdown // - [MPL115A2 - I2C Barometric Pressure/Temperature Sensor](https://www.adafruit.com/product/992) // @markdown