node-bmp180
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

Node-BMP180

Read temperature and pressure from BMP180 or BMP085 sensors using Node.js.

NPM

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

Readme

Keywords

Package Sidebar

Install

npm i node-bmp180

Weekly Downloads

3

Version

1.1.0

License

MIT

Unpacked Size

23.7 kB

Total Files

21

Last publish

Collaborators

  • thedevminertv