C# Class CyrusBuilt.MonoPi.Sensors.DS1620

This is a simple driver class for the Dallas Semiconductor DS1620 digital thermometer IC.
Inheritance: IDS1620
Show file Open project: cyrusbuilt/MonoPi Class Usage Examples

Public Methods

Method Description
DS1620 ( IGpio clock, IGpio data, IGpio reset ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Sensors.DS1620 class with the clock, data, and reset GPIO pins.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Sensors.DS1620 object.

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

GetTemperature ( ) : Double

Sends the commands to get the temperature from the sensor.

Private Methods

Method Description
ReadData ( ) : Int32

Reads 8-bit data from the DS1620.

SendCommand ( Int32 command ) : void

Sends an 8-bit command to the DS1620.

Method Details

DS1620() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Sensors.DS1620 class with the clock, data, and reset GPIO pins.
public DS1620 ( IGpio clock, IGpio data, IGpio reset ) : System
clock IGpio /// The clock pin. ///
data IGpio /// The data pin. ///
reset IGpio /// The reset pin. ///
return System

Dispose() public method

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

GetTemperature() public method

Sends the commands to get the temperature from the sensor.
/// This instance has been disposed and is no longer usable. ///
public GetTemperature ( ) : Double
return Double