C# Class CyrusBuilt.MonoPi.Components.Lights.LEDComponent

A component that is an abstraction of an LED.
Inheritance: LEDBase
显示文件 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Blink ( Int32 delay ) : void

Blinks the LED.

Blink ( Int32 delay, Int32 duration ) : void

Blinks the LED.

Dispose ( ) : void

Releases all resource used by the CyrusBuilt.MonoPi.Components.Lights.LEDComponent object.

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

LEDComponent ( IGpio pin ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LEDComponent class with the pin controlling the LED.

Off ( ) : void

Switches the LED off.

On ( ) : void

Switches the LED on.

Pulse ( Int32 duration ) : void

Pulses the state of the LED.

Pulse ( Int32 duration, System.Boolean blocking ) : void

Pulses the state of the LED.

ToString ( ) : String

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Lights.LEDComponent.

Method Details

Blink() public method

Blinks the LED.
public Blink ( Int32 delay ) : void
delay System.Int32 /// The delay between state change. ///
return void

Blink() public method

Blinks the LED.
public Blink ( Int32 delay, Int32 duration ) : void
delay System.Int32 /// The delay between state change. ///
duration System.Int32 /// The amount of time to blink the LED (in milliseconds). ///
return void

Dispose() public method

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

LEDComponent() public method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LEDComponent class with the pin controlling the LED.
/// The pin cannot be null. ///
public LEDComponent ( IGpio pin ) : System
pin IGpio /// The output pin the LED is wired to. ///
return System

Off() public method

Switches the LED off.
/// The pin is configured for input instead of output. ///
public Off ( ) : void
return void

On() public method

Switches the LED on.
/// The pin is configured for input instead of output. ///
public On ( ) : void
return void

Pulse() public method

Pulses the state of the LED.
public Pulse ( Int32 duration ) : void
duration System.Int32 /// The amount of time to pulse the LED. ///
return void

Pulse() public method

Pulses the state of the LED.
public Pulse ( Int32 duration, System.Boolean blocking ) : void
duration System.Int32 /// The amount of time to pulse the LED. ///
blocking System.Boolean /// Blocks the current thread while pulsing. ///
return void

ToString() public method

Returns a System.String that represents the current CyrusBuilt.MonoPi.Components.Lights.LEDComponent.
public ToString ( ) : String
return String