C# Class GHIElectronics.UAP.Shields.FEZUtility

A helper class for the FEZ Utility.
Inheritance: IDisposable
Show file Open project: amykatenicho/IoTWorkshop Class Usage Examples

Public Methods

Method Description
CreateAsync ( ) : Task

Creates a new instance of the FEZ Utility.

Dispose ( ) : void

Disposes of the object releasing control the pins.

ReadAnalog ( AnalogPin pin ) : double

Reads the current voltage on the given pin.

ReadDigital ( DigitalPin pin ) : bool

Reads the current state of the given pin.

SetDigitalDriveMode ( DigitalPin pin, GpioPinDriveMode driveMode ) : void

Sets the drive mode of the given pin.

SetLedState ( Led led, bool state ) : void

Sets the state of the given onboard LED.

SetPwmDutyCycle ( PwmPin pin, double value ) : void

Sets the duty cycle of the given pwm pin.

WriteDigital ( DigitalPin pin, bool state ) : void

Write the given value to the given pin.

Protected Methods

Method Description
Dispose ( bool disposing ) : void

Disposes of the object releasing control the pins.

Private Methods

Method Description
FEZUtility ( ) : System

Method Details

CreateAsync() public static method

Creates a new instance of the FEZ Utility.
public static CreateAsync ( ) : Task
return Task

Dispose() public method

Disposes of the object releasing control the pins.
public Dispose ( ) : void
return void

Dispose() protected method

Disposes of the object releasing control the pins.
protected Dispose ( bool disposing ) : void
disposing bool Whether or not this method is called from Dispose().
return void

ReadAnalog() public method

Reads the current voltage on the given pin.
public ReadAnalog ( AnalogPin pin ) : double
pin AnalogPin The pin to read.
return double

ReadDigital() public method

Reads the current state of the given pin.
public ReadDigital ( DigitalPin pin ) : bool
pin DigitalPin The pin to read.
return bool

SetDigitalDriveMode() public method

Sets the drive mode of the given pin.
public SetDigitalDriveMode ( DigitalPin pin, GpioPinDriveMode driveMode ) : void
pin DigitalPin The pin to set.
driveMode GpioPinDriveMode The new drive mode of the pin.
return void

SetLedState() public method

Sets the state of the given onboard LED.
public SetLedState ( Led led, bool state ) : void
led Led The LED to set.
state bool The new state of the LED.
return void

SetPwmDutyCycle() public method

Sets the duty cycle of the given pwm pin.
public SetPwmDutyCycle ( PwmPin pin, double value ) : void
pin PwmPin The pin to set the duty cycle for.
value double The new duty cycle between 0 (off) and 1 (on).
return void

WriteDigital() public method

Write the given value to the given pin.
public WriteDigital ( DigitalPin pin, bool state ) : void
pin DigitalPin The pin to set.
state bool The new state of the pin.
return void