Class Bme68x
Represents the Bosch BME68x Temperature, Pressure and Humidity Sensor
Assembly: Bme68x.dll
View Source
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
public Bme68x.Oversample TemperatureOversampleMode { get; set; }
PressureOversampleMode
The pressure oversampling mode
View Source
public Bme68x.Oversample PressureOversampleMode { get; set; }
HumidityOversampleMode
The humidity oversampling mode
View Source
public Bme68x.Oversample HumidityOversampleMode { get; set; }
HeaterProfile
Gets / sets the heater profile to be used for measurements
View Source
public Bme68x.HeaterProfileType HeaterProfile { get; set; }
FilterMode
Gets / sets the filtering mode to be used for measurements
View Source
public Bme68x.FilteringMode FilterMode { get; set; }
HeaterIsEnabled
Enable / disable the sensor heater
View Source
public bool HeaterIsEnabled { get; set; }
GasConversionIsEnabled
Enable / disable gas conversions
View Source
public bool GasConversionIsEnabled { get; set; }
DefaultSpiBusSpeed
The default SPI bus speed for the device
View Source
public Frequency DefaultSpiBusSpeed { get; }
SpiBusSpeed
The SPI bus speed for the device
View Source
public Frequency SpiBusSpeed { get; set; }
DefaultSpiBusMode
The default SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode DefaultSpiBusMode { get; }
SpiBusMode
The SPI bus mode for the device
View Source
public SpiClockConfiguration.Mode SpiBusMode { get; set; }
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
Temperature
The current temperature
View Source
public Temperature? Temperature { get; }
Pressure
The current pressure
View Source
public Pressure? Pressure { get; }
Humidity
The current humidity, in percent relative humidity
View Source
public RelativeHumidity? Humidity { get; }
GasResistance
The current gas resistance
View Source
public Resistance? GasResistance { get; }
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
Methods
Initialize()
Initialize the sensor
View Source
protected void Initialize()
Reset()
Perform a complete power-on-reset
View Source
public void Reset()
ConfigureHeatingProfile(HeaterProfileType, Temperature, TimeSpan, Temperature)
Configures a heater profile, making it ready for use.
View Source
public void ConfigureHeatingProfile(Bme68x.HeaterProfileType profile, Temperature targetTemperature, TimeSpan duration, Temperature ambientTemperature)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.Sensors.Atmospheric.Bme68x.HeaterProfileType | profile | The heater profile to configure |
Meadow.Units.Temperature | targetTemperature | The target temperature (0-400 C) |
System.TimeSpan | duration | The measurement duration (0-4032ms) |
Meadow.Units.Temperature | ambientTemperature | The ambient temperature |
GetPowerMode()
Get the current power mode
View Source
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
public void SetPowerMode(Bme68x.PowerMode powerMode)
Parameters
Type | Name | Description |
---|---|---|
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
public TimeSpan GetMeasurementDuration(Bme68x.HeaterProfileType profile)
Returns
System.TimeSpan
Parameters
Type | Name | Description |
---|---|---|
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
protected override void RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, RelativeHumidity? Humidity, Pressure? Pressure, Resistance? GasResistance)> changeResult)
Parameters
Type | Name | Description |
---|---|---|
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.RelativeHumidity>,System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Resistance>>> | changeResult | The updated sensor data |
ReadSensor()
Reads data from the sensor
View Source
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
protected Temperature CompensateTemperature(int rawTemperature)
Returns
Meadow.Units.Temperature
: The temperature
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | rawTemperature | The temperature value read from the device |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
View Source
public void Dispose()
Dispose(bool)
Dispose of the object
View Source
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | Is disposing |
BeforeSleep(CancellationToken)
Called before the platform goes into Sleep state
View Source
public Task BeforeSleep(CancellationToken cancellationToken)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Threading.CancellationToken | cancellationToken |
AfterWake(CancellationToken)
Called after the platform returns to Wake state
View Source
public Task AfterWake(CancellationToken cancellationToken)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Threading.CancellationToken | cancellationToken |
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