MPL3115A2
Fritzing diagram: barometer-mpl3115a2.fzz
Run this example from the command line with:
node eg/altimeter-mpl3115a2.js
const { Altimeter, Board } = require("../");
const board = new Board();
board.on("ready", () => {
const altimeter = new Altimeter({
controller: "MPL3115A2",
// Change `elevation` with whatever is reported
// on http://www.whatismyelevation.com/.
// `12` is the elevation (meters) for where I live in Brooklyn
elevation: 12
});
altimeter.on("change", () => {
const {feet, meters} = altimeter;
console.log("Altimeter:");
console.log(" feet : ", feet);
console.log(" meters : ", meters);
console.log("--------------------------------------");
});
});
Additional Notes
- MPL3115A2 - I2C Barometric Pressure/Altimiter/Thermometer Sensor
- SparkFun Altitude/Pressure Sensor Breakout - MPL3115A2
- SparkFun Weather Shield
- SparkFun Photon Weather Shield
Learn More