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, pcDuino3, Raspberry Pi, Particle/Spark Core & Photon, Tessel 2, TI Launchpad and more!
33 lines (29 loc) • 1 kB
JavaScript
var five = require("../lib/johnny-five");
var Edison = require("edison-io");
var board = new five.Board({
io: new Edison()
});
board.on("ready", function() {
// Plug the BMP180 Barometer module
// into an I2C jack
var barometer = new five.Barometer({
controller: "BMP180"
});
barometer.on("change", function() {
console.log("barometer");
console.log(" pressure : ", this.pressure);
console.log("--------------------------------------");
});
});
// @markdown
// For this program, you'll need:
//
// 
//
// 
//
// 
//
// - [Grove - Barometer Sensor (BMP180)](http://www.seeedstudio.com/depot/Grove-Barometer-Sensor-BMP180-p-1840.html)
//
// @markdown