Class MiniPID2
Represents an IonScience MiniPID2 analog photoionisation (PID) Volatile Organic Compounds (VOC) sensor
Assembly: MiniPID2.dll
View Source
public class MiniPID2 : SamplingSensorBase<Concentration>, IObservable<IChangeResult<Concentration>>, IVOCConcentrationSensor, ISamplingSensor<Concentration>, ISensor<Concentration>, ISensor, ISamplingSensor, IDisposable
Inheritance: System.Object
-> Meadow.Foundation.ObservableBase<UNIT> -> Meadow.Foundation.SamplingSensorBase<UNIT>
Implements:
System.IObservable<Meadow.IChangeResult<Meadow.Units.Concentration>>
, Meadow.Peripherals.Sensors.Environmental.IVOCConcentrationSensor
, Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>
, Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>
, Meadow.Peripherals.Sensors.ISensor
, Meadow.Peripherals.Sensors.ISamplingSensor
, System.IDisposable
Properties
VOCConcentration
The current VOC concentration value
View Source
public Concentration? VOCConcentration { get; protected set; }
MiniPID2DeviceType
The MiniPID2 device type
View Source
public MiniPID2.MiniPID2Type MiniPID2DeviceType { get; protected set; }
AnalogInputPort
View Source
protected IAnalogInputPort AnalogInputPort { get; }
IsDisposed
Is the object disposed
View Source
public bool IsDisposed { get; }
Methods
SetOffsetForSensor(Voltage, MiniPID2Type)
Set the sensor voltage offset Useful for compensating for air conditions
View Source
public void SetOffsetForSensor(Voltage offset, MiniPID2.MiniPID2Type sensorType)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Units.Voltage | offset | Offset voltage |
Meadow.Foundation.Sensors.Environmental.MiniPID2.MiniPID2Type | sensorType | The sensor to change |
GetOffsetForSensor(MiniPID2Type)
Get the voltage offset for a sensor
View Source
public Voltage GetOffsetForSensor(MiniPID2.MiniPID2Type sensorType)
Returns
Meadow.Units.Voltage
: The offset as voltage
Parameters
Type | Name | Description |
---|---|---|
Meadow.Foundation.Sensors.Environmental.MiniPID2.MiniPID2Type | sensorType | The sensor |
ReadSensor()
Convenience method to get the current concentration. For frequent reads, use StartSampling() and StopSampling() in conjunction with the SampleBuffer.
View Source
protected override Task<Concentration> ReadSensor()
Returns
System.Threading.Tasks.Task<Meadow.Units.Concentration>
: The concentration averages of the given sample count### StartUpdating(TimeSpan?)
Starts updating the sensor on the updateInterval frequency specified
View Source
public override void StartUpdating(TimeSpan? updateInterval = null)
Parameters
Type | Name |
---|---|
System.Nullable<System.TimeSpan> | updateInterval |
StopUpdating()
Stops sampling the concentration
View Source
public override void StopUpdating()
VoltageToConcentration(Voltage)
Converts voltage to Concentration
View Source
protected Concentration VoltageToConcentration(Voltage voltage)
Returns
Meadow.Units.Concentration
: Concentration
Parameters
Type | Name |
---|---|
Meadow.Units.Voltage | voltage |
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<Meadow.Units.Concentration>>
Meadow.Peripherals.Sensors.Environmental.IVOCConcentrationSensor
Meadow.Peripherals.Sensors.ISamplingSensor<Meadow.Units.Concentration>
Meadow.Peripherals.Sensors.ISensor<Meadow.Units.Concentration>
Meadow.Peripherals.Sensors.ISensor
Meadow.Peripherals.Sensors.ISamplingSensor
System.IDisposable