C# Class CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent

A component that is an abstraction of a temperature sensor device. This is an implementation of CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.
Inheritance: TemperatureSensorBase
ファイルを表示 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
ChangeScale ( TemperatureScale scale ) : void

Changes the temperature scale.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent object.

Call CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent. The CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose method leaves the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent in an unusable state. After calling CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent was occupying.

InterruptPoll ( ) : void

Interrupts the poll cycle.

Poll ( ) : void

Polls the input pin for temperature reading.

TemperatureSensorComponent ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class. This is the default constructor.

TemperatureSensorComponent ( IGpio clock, IGpio data, IGpio reset ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the clock, data, and reset pins needed for the sensor.

TemperatureSensorComponent ( TemperatureScale scale ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the scale to get the temperature in.

TemperatureSensorComponent ( TemperatureScale scale, IGpio clock, IGpio data, IGpio reset ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the clock, data, and reset pins needed for the sensor, as well as the scale to get the temperature readings in.

Protected Methods

Method Description
Dispose ( System.Boolean disposing ) : void

Releaseses all resources used this object.

Private Methods

Method Description
BackgroundExecutePoll ( ) : void

Executes the poll cycle on a background thread.

ExecutePoll ( ) : void

Executes the poll cycle. Does not return until CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.InterruptPoll is called.

Method Details

ChangeScale() public method

Changes the temperature scale.
public ChangeScale ( TemperatureScale scale ) : void
scale TemperatureScale /// The scale to change to. ///
return void

Dispose() public method

Releases all resource used by the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent object.
Call CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose when you are finished using the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent. The CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose method leaves the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent in an unusable state. After calling CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent.Dispose, you must release all references to the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent so the garbage collector can reclaim the memory that the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent was occupying.
public Dispose ( ) : void
return void

Dispose() protected method

Releaseses all resources used this object.
protected Dispose ( System.Boolean disposing ) : void
disposing System.Boolean /// Set true if disposing managed resources in addition to unmanaged. ///
return void

InterruptPoll() public method

Interrupts the poll cycle.
public InterruptPoll ( ) : void
return void

Poll() public method

Polls the input pin for temperature reading.
/// This instance has been disposed. ///
public Poll ( ) : void
return void

TemperatureSensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class. This is the default constructor.
public TemperatureSensorComponent ( ) : System
return System

TemperatureSensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the clock, data, and reset pins needed for the sensor.
/// Pins cannot be null. ///
public TemperatureSensorComponent ( IGpio clock, IGpio data, IGpio reset ) : System
clock IGpio /// The GPIO pin used for the clock. ///
data IGpio /// The GPIO pin used for data. ///
reset IGpio /// The GPIO pin used to trigger reset. ///
return System

TemperatureSensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the scale to get the temperature in.
public TemperatureSensorComponent ( TemperatureScale scale ) : System
scale TemperatureScale /// The scale to get the temperature readings in. ///
return System

TemperatureSensorComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Temperature.TemperatureSensorComponent class with the clock, data, and reset pins needed for the sensor, as well as the scale to get the temperature readings in.
/// Pins cannot be null. ///
public TemperatureSensorComponent ( TemperatureScale scale, IGpio clock, IGpio data, IGpio reset ) : System
scale TemperatureScale /// The scale to get the temperature readings in. ///
clock IGpio /// The GPIO pin used for the clock. ///
data IGpio /// The GPIO pin used for data. ///
reset IGpio /// The GPIO pin used to trigger reset. ///
return System