LPS22HB pressure sensor

LPS22HB is an I2C pressure sensor from ST, which is handled with the LPS22HB module.

How to use

I2C1.setup({scl:B6,sda:B7});
var pressure = require("LPS22HB").connectI2C(I2C1);
pressure.read(print);
// prints { "pressure": 1017.3583984375, "temperature": 22.62 }

Or specify an interrupt pin to have data 'pushed':

var pressure = require("LPS22HB").connectI2C(I2C1, {int : B8});
pressure.on('data', print);
// prints { "pressure": 1017.3583984375, "temperature": 22.62 }

Reference

// Shut down the sensor
LPS22HB.prototype.stop = function () { ... }

/* Get the current pressure value. Returns:

{ 
  pressure : float,     // pressure in hPa
  temperature : float,  // temperature in degrees C
  new : bool,           // is this a new reading?
}
*/
LPS22HB.prototype.get = function () { ... }

// Call the callback with a new pressure value
LPS22HB.prototype.read = function (callback) { ... }

/* Initialise the LPS22HB module with the given I2C interface  (and optional address with connectI2C(i2c,{addr:...}) )
See 'LPS22HB' above for more options
*/
exports.connectI2C = function (i2c, options) { ... }

Using

This page is auto-generated from GitHub. If you see any mistakes or have suggestions, please let us know.