bmp085

1.0.0 • Public • Published

BMP085

A node.js module for reading Adafruit's Bosch BMP085 barometer sensor using i2c.

Install

$ npm install bmp085

Raspberry Pi users: Remember to enable i2c on your Pi if you haven't done already.

Also remember to use sudo when running your program if you haven't exported your GPIO pins to user space.

Usage

The module's read function takes a callback function as an argument. The callback will receive an object with the temperature (in degrees Celcius) and air pressure (in hPa).

Example:

var BMP085 = require('bmp085'),
    barometer = new BMP085();

barometer.read(function (data) {
    if (data !== null) {
        console.log("Temperature:", data.temperature);
        console.log("Pressure:", data.pressure);
    }
});

Configuration

Configure the sensor by supplying an options object to the constructor:

new BMP085(
    {
        'mode': 1,
        'address': 0x77,
        'device': '/dev/i2c-1'
    }
);

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i bmp085

    Weekly Downloads

    9

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    9.9 kB

    Total Files

    4

    Last publish

    Collaborators

    • fiskeben