Permalink
Fetching contributors…
Cannot retrieve contributors at this time
121 lines (67 sloc) 2.29 KB

Altimeter - BMP085

BMP085

docs/breadboard/multi-bmp085-sfe.png

Fritzing diagram: docs/breadboard/multi-bmp085-sfe.fzz

 

Run this example from the command line with:

node eg/altimeter-BMP085.js
var five = require("../");
var board = new five.Board();

board.on("ready", function() {
  // By including a base `elevation` property, the values
  // received will be absolute elevation (from sealevel)
  var altimeter = new five.Altimeter({
    controller: "BMP085",
    // 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", function() {
    console.log("Altimeter");
    console.log("  feet         : ", this.feet);
    console.log("  meters       : ", this.meters);
    console.log("--------------------------------------");
  });
});

Alternates

BMP085 - Relative Elevation

var five = require("johnny-five");
var board = new five.Board();

board.on("ready", function() {
  // By omitting the base `elevation` property, the values
  // received will be relative to your present elevation
  var altimeter = new five.Altimeter({
    controller: "BMP085",
  });

  altimeter.on("change", function() {
    console.log("Altimeter");
    console.log("  feet         : ", this.feet);
    console.log("  meters       : ", this.meters);
    console.log("--------------------------------------");
  });
});

Illustrations / Photos

BMP085 (Adafruit)

docs/breadboard/multi-bmp085.png

Fritzing diagram: docs/breadboard/multi-bmp085.fzz

 

Learn More

 

License

Copyright (c) 2012-2014 Rick Waldron waldron.rick@gmail.com Licensed under the MIT license. Copyright (c) 2015-2018 The Johnny-Five Contributors Licensed under the MIT license.