Class Bmp280
BMP280 Temperature and Pressure Sensor
Assembly: Bmx280.dll
View Source
public class Bmp280 : PollingSensorBase<(Temperature? Temperature, Pressure? Pressure)>, IObservable<IChangeResult<(Temperature? Temperature, Pressure? Pressure)>>, ISamplingSensor<(Temperature? Temperature, Pressure? Pressure)>, ISensor<(Temperature? Temperature, Pressure? Pressure)>, ITemperatureSensor, ISamplingSensor<Temperature>, ISensor<Temperature>, IBarometricPressureSensor, ISamplingSensor<Pressure>, ISensor<Pressure>, ISensor, ISamplingSensor, ISpiPeripheral, II2cPeripheral, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT>
Implements:
Expand
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>>
, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>
, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>
, Meadow.Peripherals.Sensors.ITemperatureSensor
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
, Meadow.Peripherals.Sensors.Atmospheric.IBarometricPressureSensor
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Pressure>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Pressure>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
, Meadow.Hardware.ISpiPeripheral
, Meadow.Hardware.II2cPeripheral
, System.IDisposable
Properties
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
TemperatureSampleCount
Temperature oversample count
View Source
public Bmx280.Oversample TemperatureSampleCount { get; set; }
PressureSampleCount
Pressure oversample count
View Source
public Bmx280.Oversample PressureSampleCount { get; set; }
Temperature
The temperature from the last reading
View Source
public Temperature? Temperature { get; }
Pressure
The pressure from the last reading
View Source
public Pressure? Pressure { get; }
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; }
Fields
readBuffer
The read buffer
View Source
protected Memory<byte> readBuffer
writeBuffer
The write buffer
View Source
protected Memory<byte> writeBuffer
Methods
Initialize()
Initialize the sensor
View Source
protected void Initialize()
RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, Pressure? Pressure)>)
Raise events for subscribers and notify of value changes
View Source
protected override void RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, Pressure? Pressure)> changeResult)
Parameters
Type | Name | Description |
---|---|---|
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>> | changeResult | The updated sensor data |
ReadSensor()
Update the sensor information from the BME280.
View Source
protected override Task<(Temperature? Temperature, Pressure? Pressure)> ReadSensor()
Returns
System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>
Reset()
Reset the sensor.
View Source
public void Reset()
GetChipID()
Get the chip ID
View Source
public byte GetChipID()
Returns
System.Byte
: The ID as a byte### StartUpdating(TimeSpan?)
Start updating
View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
Type | Name | Description |
---|---|---|
System.Nullable<System.TimeSpan> | updateInterval | The update inverval |
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 |
Implements
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>>
Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>
Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Temperature>,System.Nullable<Meadow.Units.Pressure>>>
Meadow.Peripherals.Sensors.ITemperatureSensor
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Temperature>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Temperature>
Meadow.Peripherals.Sensors.Atmospheric.IBarometricPressureSensor
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Pressure>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Pressure>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor
Meadow.Hardware.ISpiPeripheral
Meadow.Hardware.II2cPeripheral
System.IDisposable