Table of Contents

Class Bme280

Namespace
Iot.Device.Bmxx80
Assembly
Iot.Device.Bmxx80.dll

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

i2cDevice I2cDevice

The I2cDevice to create with.

Properties

HumiditySampling

Gets or sets the humidity sampling.

[Property]
public Sampling HumiditySampling { get; set; }

Property Value

Sampling

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

Bme280ReadResult

Bme280ReadResult

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 RelativeHumidity

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

bool
true
if measurement was not skipped, otherwise
false
.