Class Bme280
Represents a BME280 temperature, barometric pressure and humidity sensor.
[Interface("Represents a BME280 temperature, barometric pressure and humidity sensor.")]
public class Bme280 : Bmx280Base
- Inheritance
-
Bme280
- Inherited Members
Constructors
Bme280(I2cDevice)
Initializes a new instance of the Bme280 class.
public Bme280(I2cDevice i2cDevice)
Parameters
Properties
HumiditySampling
Gets or sets the humidity sampling.
[Property]
public Sampling HumiditySampling { get; set; }
Property Value
Exceptions
- ArgumentOutOfRangeException
Thrown when the Sampling is set to an undefined mode.
Methods
GetMeasurementDuration()
Gets the required time in ms to perform a measurement with the current sampling modes.
public override int GetMeasurementDuration()
Returns
- int
The time it takes for the chip to read data in milliseconds rounded up.
Read()
Performs a synchronous reading.
public Bme280ReadResult Read()
Returns
SetDefaultConfiguration()
Sets the default configuration for the sensor.
protected override void SetDefaultConfiguration()
TryReadHumidity(out RelativeHumidity)
Reads the humidity. A return value indicates whether the reading succeeded.
[Telemetry("Humidity")]
public bool TryReadHumidity(out RelativeHumidity humidity)
Parameters
humidity
RelativeHumidityContains the measured humidity as %rH if the HumiditySampling was not set to Skipped. Contains an undefined value if the return value is false.
Returns
- bool
if measurement was not skipped, otherwisetrue
.false