node-bmp180
v1.1.0
Published
A module to interface with BMP180/BMP085 temperature and pressure sensor from Node.js.
Downloads
7
Readme
Node-BMP180
Read temperature and pressure from BMP180 or BMP085 sensors using Node.js.
Install
$ npm install node-bmp180
$ yarn add node-bmp180
Usage
With no units specified this library returns temperature in Celsius and pressure in Pascal.
const BMP180 = require('node-bmp180');
const sensor = new BMP180.BMP180({
address: 0x77,
mode: BMP180.Mode.UltraHighResolution
});
(async () => {
const { pressure, temp } = await sensor.read();
console.log(`Pressure: ${pressure} Pa`);
console.log(`Temperature: ${temp} C`);
})();
const BMP180 = require('node-bmp180');
const sensor = new BMP180.BMP180({
address: 0x77,
mode: BMP180.Mode.UltraHighResolution,
units: {
temperature: BMP180.TemperatureUnit.Fahrenheit,
pressure: BMP180.PressureUnit.InchesOfMercury
}
});
(async () => {
const { pressure, temp } = await sensor.read();
console.log(`Pressure: ${pressure} inHg`);
console.log(`Temperature: ${temp} F`);
})();
Legacy package
- https://www.npmjs.com/package/bmp085-sensor
- https://github.com/dbridges/bmp085-sensor