.. highlight:: java Barometer ========= Select MbientLab boards are equipped with Bosch environmental sensors, either the `BMP280 `_ or the `BME280 `_. These devices measure absolute barometeric pressure and can also measure :doc:`temperature `. For pressuring sensing both devices have similar configuration parameters with the exception of slightly different available standby times. Developer's can use either the `IBarometerBmp280 `_ or `IBarometerBme280 `_ subclasses to configure the device with their respective standby enum values, or use the `IBarometerBosch `_ base class for barometer agnostic apps. :: using MbientLab.MetaWear.Sensor; IBarometerBosch baroBosch = metawear.GetModule(); Configuration ------------- There are 3 parameters working in conjunction to control the noise, output resolution, and sampling rate: * Oversampling * Infinite impulse filter (iir) coefficient * Standby time The datasheets for the `BMP280 `_ (table 14 and 15) and `BME280 `_ (section 5.5) have recommended settings for different use cases. :: using MbientLab.MetaWear.Sensor.BarometerBosch; // configure the barometer with suggested values for // indoor navigation barometer.Configure(os = Oversampling.UltraHigh, coeff: IirFilerCoeff._16, standbyTime: 0.5f); Pressure Data ------------- Pressure data reported by the firmware is in Pascals (pa) and interpreted as a float value by the app side. :: await barometer.Pressure.AddRouteAsync(source => source.Stream(data => Console.WriteLine("Pressure (Pa) = " + data.Value())) ); Altitude Data ------------- Altitude data reported by the firmware is in meters (m) and interpreted as a float value by the app side. :: await barometer.Altitude.AddRouteAsync(source => source.Stream(data => Console.WriteLine("Altitude (m) = " + data.Value())) );