neo-barometer
Node.js module for retrieving data from the barometer brick for the UDOO Neo. Gets atmospheric pressure in pascals, temperature in kelvin and altitude in meters.
A note on altitude: the value is derived from measured temperature, measured atmospheric pressure and
a fixed atmospheric pressure at sea level (P0
, 1013.25 hPa). P0
could be different at your location, so the calculed
altitude might not be accurate.
Important: this modules uses ES2015 (ES6) features, so use a modern version of node.js (v4.x, v5.x etc)
Installation
// In a local projectnpm install --save neo-barometer // For global usagenpm install -g neo-barometer
Usage (cli)
When installed globally, the module installs four cli tools in your PATH
:
altitude
: outputs altitude in meter tostdout
pressure [--unit hpa]
: outputs pressure in pascal tostdout
. Change unit with flag--unit [hpa|kpa|pa]
temperature [--unit celcius]
: outputs temperature in Kelvin tostdout
. Change unit with flag--unit [c|celcius|f|fahrenheit|K|Kelvin]
barometer
: outputs all values in stringified JSON tostdout
.
Usage (module)
The module exports four Readable Streams:
barometer.Temperature
: a stream of temperature values in degrees celcius.barometer.Pressure
: a stream of atmospheric pressure values in pascals.barometer.Altitude
: a stream of altitude values in meters.barometer.Compound
: a stream of objects that contain all three values (temperature, pressure & altitude).
let barometer = ; // 1. Just temperaturelet temperature = ;temperature;temperature; // 2. Just pressure let pressure = ;pressure;pressure; // 3. Just altitudelet altitude = ;altitude;altitude; // 4. Compound (all values)let compound = ;compound;compound;