Syntax
public class Mcp9808 : FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions>, IObservable<AtmosphericConditionChangeResult>, IAtmosphericSensor, ITemperatureSensor
Constructors
Mcp9808(II2cBus, Byte)
Declaration
public Mcp9808(II2cBus i2CBus, byte address = 24)
Parameters
Type |
Name |
Description |
II2cBus |
i2CBus |
|
System.Byte |
address |
|
Fields
DefaultAddress
Declaration
public const byte DefaultAddress = 24
Field Value
Type |
Description |
System.Byte |
|
Properties
Conditions
The AtmosphericConditions from the last reading.
Declaration
public AtmosphericConditions Conditions { get; protected set; }
Property Value
Type |
Description |
AtmosphericConditions |
|
IsSampling
Declaration
public bool IsSampling { get; protected set; }
Property Value
Type |
Description |
System.Boolean |
|
Temperature
Declaration
public float Temperature { get; }
Property Value
Type |
Description |
System.Single |
|
Methods
GetDeviceId()
Declaration
public ushort GetDeviceId()
Returns
Type |
Description |
System.UInt16 |
|
GetManufactureId()
Declaration
public ushort GetManufactureId()
Returns
Type |
Description |
System.UInt16 |
|
GetResolution()
Declaration
public byte GetResolution()
Returns
Type |
Description |
System.Byte |
|
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> |
|
SetResolution(Byte)
Declaration
public void SetResolution(byte resolution)
Parameters
Type |
Name |
Description |
System.Byte |
resolution |
|
Sleep()
Set the device into a low power sleep state
Declaration
StartUpdating(Int32)
Begin reading temperature data
Declaration
public void StartUpdating(int standbyDuration = 1000)
Parameters
Type |
Name |
Description |
System.Int32 |
standbyDuration |
|
StopUpdating()
Stops sampling the temperature.
Declaration
public void StopUpdating()
Update()
Update the Temperature property.
Declaration
Wake()
Wake the the device if it's in sleep state
Declaration
Events
Updated
Declaration
public event EventHandler<AtmosphericConditionChangeResult> Updated
Event Type
Type |
Description |
System.EventHandler<AtmosphericConditionChangeResult> |
|