Skip to main content

Class Bme68x

Represents the Bosch BME68x Temperature, Pressure and Humidity Sensor

Assembly: Bme68x.dll
View Source
Declaration
public abstract class Bme68x : PollingSensorBase<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)>, IObservable<IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)>>, ISamplingSensor<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)>, ISensor<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)>, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IHumiditySensor, ISamplingSensor<RelativeHumidity>, ISensor<RelativeHumidity>, IBarometricPressureSensor, ISamplingSensor<Pressure>, ISensor<Pressure>, IGasResistanceSensor, ISamplingSensor<Resistance>, ISensor<Resistance>, ISensor, ISamplingSensor, ISpiPeripheral, II2cPeripheral, ISleepAwarePeripheral, IDisposable

Inheritance: System.Object -> Meadow.Foundation.ObservableBase<UNIT>

Derived:
Meadow.Foundation.Sensors.Atmospheric.Bme680

Implements:

Expand

System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>>, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>, Meadow.Peripherals.Sensors.ITemperatureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>, Meadow.Peripherals.Sensors.Atmospheric.IHumiditySensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.RelativeHumidity>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.RelativeHumidity>, Meadow.Peripherals.Sensors.Atmospheric.IBarometricPressureSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Pressure>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Pressure>, Meadow.Peripherals.Sensors.Environmental.IGasResistanceSensor, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Resistance>, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Resistance>, Meadow.Peripherals.Sensors.ISensor, Meadow.Peripherals.Sensors.ISamplingSensor, Meadow.Hardware.ISpiPeripheral, Meadow.Hardware.II2cPeripheral, Meadow.ISleepAwarePeripheral, System.IDisposable

Properties

TemperatureOversampleMode

The temperature oversampling mode

View Source
Declaration
public Bme68x.Oversample TemperatureOversampleMode { get; set; }

PressureOversampleMode

The pressure oversampling mode

View Source
Declaration
public Bme68x.Oversample PressureOversampleMode { get; set; }

HumidityOversampleMode

The humidity oversampling mode

View Source
Declaration
public Bme68x.Oversample HumidityOversampleMode { get; set; }

HeaterProfile

Gets / sets the heater profile to be used for measurements

View Source
Declaration
public Bme68x.HeaterProfileType HeaterProfile { get; set; }

FilterMode

Gets / sets the filtering mode to be used for measurements

View Source
Declaration
public Bme68x.FilteringMode FilterMode { get; set; }

HeaterIsEnabled

Enable / disable the sensor heater

View Source
Declaration
public bool HeaterIsEnabled { get; set; }

GasConversionIsEnabled

Enable / disable gas conversions

View Source
Declaration
public bool GasConversionIsEnabled { get; set; }

DefaultSpiBusSpeed

The default SPI bus speed for the device

View Source
Declaration
public Frequency DefaultSpiBusSpeed { get; }

SpiBusSpeed

The SPI bus speed for the device

View Source
Declaration
public Frequency SpiBusSpeed { get; set; }

DefaultSpiBusMode

The default SPI bus mode for the device

View Source
Declaration
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }

SpiBusMode

The SPI bus mode for the device

View Source
Declaration
public SpiClockConfiguration.Mode SpiBusMode { get; set; }

DefaultI2cAddress

The default I2C address for the peripheral

View Source
Declaration
public byte DefaultI2cAddress { get; }

Temperature

The current temperature

View Source
Declaration
public Temperature? Temperature { get; }

Pressure

The current pressure

View Source
Declaration
public Pressure? Pressure { get; }

Humidity

The current humidity, in percent relative humidity

View Source
Declaration
public RelativeHumidity? Humidity { get; }

GasResistance

The current gas resistance

View Source
Declaration
public Resistance? GasResistance { get; }

IsDisposed

Is the object disposed

View Source
Declaration
public bool IsDisposed { get; }

Methods

Initialize()

Initialize the sensor

View Source
Declaration
protected void Initialize()

Reset()

Perform a complete power-on-reset

View Source
Declaration
public void Reset()

ConfigureHeatingProfile(HeaterProfileType, Temperature, TimeSpan, Temperature)

Configures a heater profile, making it ready for use.

View Source
Declaration
public void ConfigureHeatingProfile(Bme68x.HeaterProfileType profile, Temperature targetTemperature, TimeSpan duration, Temperature ambientTemperature)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Atmospheric.Bme68x.HeaterProfileTypeprofileThe heater profile to configure
Meadow.Units.TemperaturetargetTemperatureThe target temperature (0-400 C)
System.TimeSpandurationThe measurement duration (0-4032ms)
Meadow.Units.TemperatureambientTemperatureThe ambient temperature

GetPowerMode()

Get the current power mode

View Source
Declaration
public Bme68x.PowerMode GetPowerMode()
Returns

Meadow.Foundation.Sensors.Atmospheric.Bme68x.PowerMode: The power mode### SetPowerMode(PowerMode) Sets the power mode to the given mode

View Source
Declaration
public void SetPowerMode(Bme68x.PowerMode powerMode)
Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Atmospheric.Bme68x.PowerMode to set.

GetMeasurementDuration(HeaterProfileType)

Gets the required time in to perform a measurement. The duration of the gas measurement is not considered if Meadow.Foundation.Sensors.Atmospheric.Bme68x.GasConversionIsEnabled is set to false or the chosen Meadow.Foundation.Sensors.Atmospheric.Bme68x.HeaterProfile is not configured. The precision of this duration is within 1ms of the actual measurement time.

View Source
Declaration
public TimeSpan GetMeasurementDuration(Bme68x.HeaterProfileType profile)
Returns

System.TimeSpan

Parameters
TypeNameDescription
Meadow.Foundation.Sensors.Atmospheric.Bme68x.HeaterProfileType.

RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)>)

Raise events for subscribers and notify of value changes

View Source
Declaration
protected override void RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)> changeResult)
Parameters
TypeNameDescription
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>changeResultThe updated sensor data

ReadSensor()

Reads data from the sensor

View Source
Declaration
protected override Task<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)> ReadSensor()
Returns

System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>: The latest sensor reading### CompensateTemperature(int) Compensates the temperature

View Source
Declaration
protected Temperature CompensateTemperature(int rawTemperature)
Returns

Meadow.Units.Temperature: The temperature

Parameters
TypeNameDescription
System.Int32rawTemperatureThe temperature value read from the device

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
Declaration
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

BeforeSleep(CancellationToken)

Called before the platform goes into Sleep state

View Source
Declaration
public Task BeforeSleep(CancellationToken cancellationToken)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokencancellationToken

AfterWake(CancellationToken)

Called after the platform returns to Wake state

View Source
Declaration
public Task AfterWake(CancellationToken cancellationToken)
Returns

System.Threading.Tasks.Task

Parameters
TypeName
System.Threading.CancellationTokencancellationToken

Implements

  • System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>>
  • Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>
  • Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>>
  • Meadow.Peripherals.Sensors.ITemperatureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
  • Meadow.Peripherals.Sensors.Atmospheric.IHumiditySensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.RelativeHumidity>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.RelativeHumidity>
  • Meadow.Peripherals.Sensors.Atmospheric.IBarometricPressureSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Pressure>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Pressure>
  • Meadow.Peripherals.Sensors.Environmental.IGasResistanceSensor
  • Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Resistance>
  • Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Resistance>
  • Meadow.Peripherals.Sensors.ISensor
  • Meadow.Peripherals.Sensors.ISamplingSensor
  • Meadow.Hardware.ISpiPeripheral
  • Meadow.Hardware.II2cPeripheral
  • Meadow.ISleepAwarePeripheral
  • System.IDisposable