Characteristic Locus
Inheritance System.Object FilterableChangeObservableBase<AtmosphericConditionChangeResult, AtmosphericConditions> > Mcp9808
Implements System.IObservable<AtmosphericConditionChangeResult> IAtmosphericSensor ITemperatureSensor
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.Temperature
Assembly Mcp9808.dll

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()

Read the device ID

Declaration
public ushort GetDeviceId()

Returns

Type Description
System.UInt16

GetManufactureId()

Read the manufacture ID

Declaration
public ushort GetManufactureId()

Returns

Type Description
System.UInt16

GetResolution()

Read resolution

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)

Set resolution

Declaration
public void SetResolution(byte resolution)

Parameters

Type Name Description
System.Byte resolution

Sleep()

Set the device into a low power sleep state

Declaration
public void Sleep()

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
public void Update()

Wake()

Wake the the device if it's in sleep state

Declaration
public void Wake()

Events

Updated

Declaration
public event EventHandler<AtmosphericConditionChangeResult> Updated

Event Type

Type Description
System.EventHandler<AtmosphericConditionChangeResult>