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

A component that is an abstraction of an LED.
Inheritance: LEDBase
Afficher le fichier Open project: cyrusbuilt/MonoPi

Méthodes publiques

Méthode 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 méthode

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

Blink() public méthode

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). ///
Résultat void

Dispose() public méthode

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
Résultat void

LEDComponent() public méthode

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. ///
Résultat System

Off() public méthode

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

On() public méthode

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

Pulse() public méthode

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

Pulse() public méthode

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. ///
Résultat void

ToString() public méthode

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