Class AdafruitMPRLS
Device driver for the Adafruit MPRLS Ported Pressure Sensor Breakout
Assembly: AdafruitMPRLS.dll
View Source
public class AdafruitMPRLS : ByteCommsSensorBase<(Pressure? Pressure, Pressure? RawPsiMeasurement)>, IObservable<IChangeResult<(Pressure? Pressure, Pressure? RawPsiMeasurement)>>, ISamplingSensor<(Pressure? Pressure, Pressure? RawPsiMeasurement)>, ISensor<(Pressure? Pressure, Pressure? RawPsiMeasurement)>, IDisposable, II2cPeripheral, IBarometricPressureSensor, ISamplingSensor<Pressure>, ISensor<Pressure>, ISensor, ISamplingSensor
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT>
Implements:
Expand
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>>
, Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>
, Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>
, System.IDisposable
, Meadow.Hardware.II2cPeripheral
, 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
Properties
DefaultI2cAddress
The default I2C address for the peripheral
View Source
public byte DefaultI2cAddress { get; }
IsDevicePowered
Set by the sensor, to tell us it has power.
View Source
public bool IsDevicePowered { get; set; }
IsDeviceBusy
Set by the sensor, to tell us it's busy.
View Source
public bool IsDeviceBusy { get; set; }
HasMemoryIntegrityFailed
Set by the sensor, to tell us whether or not there's an issue with its own memory.
View Source
public bool HasMemoryIntegrityFailed { get; set; }
RawPsiMeasurement
Returns the current raw pressure value in pounds per square inch (PSI)
View Source
public Pressure? RawPsiMeasurement { get; }
Pressure
Returns the current pressure reading
View Source
public Pressure? Pressure { get; }
InternalMathSaturated
Indicates the sensor has reached its pressure limit.
View Source
public bool InternalMathSaturated { get; set; }
Methods
RaiseEventsAndNotify(IChangeResult<(Pressure? Pressure, Pressure? RawPsiMeasurement)>)
Notify subscribers of PressureUpdated event handler
View Source
protected override void RaiseEventsAndNotify(IChangeResult<(Pressure? Pressure, Pressure? RawPsiMeasurement)> changeResult)
Parameters
Type | Name |
---|---|
Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>> | changeResult |
ReadSensor()
Convenience method to get the current Pressure. For frequent reads, use StartSampling() and StopSampling() in conjunction with the SampleBuffer.
View Source
protected override Task<(Pressure? Pressure, Pressure? RawPsiMeasurement)> ReadSensor()
Returns
System.Threading.Tasks.Task<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>
Implements
System.IObservable<Meadow.IChangeResult<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>>
Meadow.Peripherals.Sensors.ISamplingSensor<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>
Meadow.Peripherals.Sensors.ISensor<System.ValueTuple<System.Nullable<Meadow.Units.Pressure>,System.Nullable<Meadow.Units.Pressure>>>
System.IDisposable
Meadow.Hardware.II2cPeripheral
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