Remarks
GroveTH02 | |
---|---|
Status | Not tested |
Source code | GitHub |
NuGet package | Not published |
The GroveTH02 is a multifunctional sensor that gives you temperature and relative humidity information at the same time with I2C interface. It utilizes a TH02 sensor that can meet measurement needs of general purposes. It provides reliable readings when environment humidity condition in between 0-80% RH, and temperature condition in between 0-70°C, covering needs in most home and daily applications that don't contain extreme conditions.
Wiring Example
Characteristic | Locus |
---|---|
Inheritance | System.Object FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions> > GroveTh02 |
Implements | System.IObservable<AtmosphericConditionChangeResult> IAtmosphericSensor ITemperatureSensor IHumiditySensor |
Inherited Members | FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>._observers FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>.NotifyObservers(AtmosphericConditionChangeResult) FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>.Subscribe(IObserver<AtmosphericConditionChangeResult>) System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone() |
Namespace | Meadow.Foundation.Sensors.Atmospheric |
Assembly | GroveTH02.dll |
Syntax
public class GroveTh02 : FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>, IObservable<AtmosphericConditionChangeResult>, IAtmosphericSensor, ITemperatureSensor, IHumiditySensor
Constructors
GroveTh02(II2cBus, Byte)
Create a new GroveTH02 object using the default parameters for the component.
Declaration
public GroveTh02(II2cBus i2cBus, byte address = 64)
Parameters
Type | Name | Description |
---|---|---|
II2cBus | i2cBus | I2C bus (default = 100 KHz). |
System.Byte | address | Address of the Grove TH02 (default = 0x4-). |
Fields
MinimumPollingPeriod
Minimum value that should be used for the polling frequency.
Declaration
public const ushort MinimumPollingPeriod = 200
Field Value
Type | Description |
---|---|
System.UInt16 |
Properties
Conditions
The AtmosphericConditions from the last reading.
Declaration
public AtmosphericConditions Conditions { get; protected set; }
Property Value
Type | Description |
---|---|
AtmosphericConditions |
HeaterOn
Get / set the heater status.
Declaration
public bool HeaterOn { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Humidity
The humidity, in percent relative humidity, from the last reading..
Declaration
public float Humidity { get; }
Property Value
Type | Description |
---|---|
System.Single |
IsSampling
Gets a value indicating whether the analog input port is currently sampling the ADC. Call StartSampling() to spin up the sampling process.
Declaration
public bool IsSampling { get; protected set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Temperature
The temperature, in degrees celsius (°C), from the last reading.
Declaration
public float Temperature { get; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
RaiseChangedAndNotify(AtmosphericConditionChangeResult)
Declaration
protected void RaiseChangedAndNotify(AtmosphericConditionChangeResult changeResult)
Parameters
Type | Name | Description |
---|---|---|
AtmosphericConditionChangeResult | changeResult |
Read()
Convenience method to get the current sensor readings. For frequent reads, use StartSampling() and StopSampling() in conjunction with the SampleBuffer.
Declaration
public Task<AtmosphericConditions> Read()
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<AtmosphericConditions> |
StartUpdating(Int32)
Declaration
public void StartUpdating(int standbyDuration = 1000)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | standbyDuration |
StopUpdating()
Stops sampling the temperature.
Declaration
public void StopUpdating()
Events
Updated
Declaration
public event EventHandler<AtmosphericConditionChangeResult> Updated
Event Type
Type | Description |
---|---|
System.EventHandler<AtmosphericConditionChangeResult> |