Skip to main content

Class Bmp280

BMP280 Temperature and Pressure Sensor

Assembly: Bmx280.dll
View Source
Declaration
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
Declaration
public bool IsDisposed { get; }

TemperatureSampleCount

Temperature oversample count

View Source
Declaration
public Bmx280.Oversample TemperatureSampleCount { get; set; }

PressureSampleCount

Pressure oversample count

View Source
Declaration
public Bmx280.Oversample PressureSampleCount { get; set; }

Temperature

The temperature from the last reading

View Source
Declaration
public Temperature? Temperature { get; }

Pressure

The pressure from the last reading

View Source
Declaration
public Pressure? Pressure { get; }

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; }

Fields

readBuffer

The read buffer

View Source
Declaration
protected Memory<byte> readBuffer

writeBuffer

The write buffer

View Source
Declaration
protected Memory<byte> writeBuffer

Methods

Initialize()

Initialize the sensor

View Source
Declaration
protected void Initialize()

RaiseEventsAndNotify(IChangeResult<(Temperature? Temperature, Pressure? Pressure)>)

Raise events for subscribers and notify of value changes

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

ReadSensor()

Update the sensor information from the BME280.

View Source
Declaration
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
Declaration
public void Reset()

GetChipID()

Get the chip ID

View Source
Declaration
public byte GetChipID()
Returns

System.Byte: The ID as a byte### StartUpdating(TimeSpan?) Start updating

View Source
Declaration
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
TypeNameDescription
System.Nullable<System.TimeSpan>updateIntervalThe update inverval

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

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