Class Bme280
Represents a BME280 temperature, barometric pressure and humidity sensor.
Inherited Members
Namespace: Iot.Device.Bmxx80
Assembly: Iot.Device.Bmxx80.dll
Syntax
[Interface("Represents a BME280 temperature, barometric pressure and humidity sensor.")]
public class Bme280 : Bmx280Base
Constructors
Bme280(I2cDevice)
Initializes a new instance of the Bme280 class.
Declaration
public Bme280(I2cDevice i2cDevice)
Parameters
Type | Name | Description |
---|---|---|
I2cDevice | i2cDevice | The I2cDevice to create with. |
Properties
HumiditySampling
Gets or sets the humidity sampling.
Declaration
[Property]
public Sampling HumiditySampling { get; set; }
Property Value
Type | Description |
---|---|
Sampling |
Exceptions
Type | Condition |
---|---|
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.
Declaration
public override int GetMeasurementDuration()
Returns
Type | Description |
---|---|
int | The time it takes for the chip to read data in milliseconds rounded up. |
Overrides
Read()
Performs a synchronous reading.
Declaration
public Bme280ReadResult Read()
Returns
Type | Description |
---|---|
Bme280ReadResult |
SetDefaultConfiguration()
Sets the default configuration for the sensor.
Declaration
protected override void SetDefaultConfiguration()
Overrides
TryReadHumidity(out RelativeHumidity)
Reads the humidity. A return value indicates whether the reading succeeded.
Declaration
[Telemetry("Humidity")]
public bool TryReadHumidity(out RelativeHumidity humidity)
Parameters
Type | Name | Description |
---|---|---|
RelativeHumidity | humidity | Contains the measured humidity as %rH if the HumiditySampling was not set to Skipped. Contains an undefined value if the return value is false. |
Returns
Type | Description |
---|---|
bool | if measurement was not skipped, otherwise .
|