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

Base class for LED component abstractions.
Inheritance: ComponentBase, ILED
显示文件 Open project: cyrusbuilt/MonoPi

Public Methods

Method Description
Blink ( Int32 delay ) : void

Blinks the LED.

Blink ( Int32 delay, Int32 duration ) : void

Blinks the LED.

Off ( ) : void

Switches the light off.

On ( ) : void

Switches the light on.

Pulse ( Int32 duration ) : void

Pulses the state of the LED.

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

Pulses the state of the LED.

Toggle ( ) : void

Toggles the state of the LED.

Protected Methods

Method Description
LEDBase ( ) : System

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LEDBase class. This is the default constructor.

OnStateChanged ( LightStateChangeEventArgs e ) : void

Raises the state changed event.

Method Details

Blink() public abstract method

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

Blink() public abstract method

Blinks the LED.
public abstract 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

LEDBase() protected method

Initializes a new instance of the CyrusBuilt.MonoPi.Components.Lights.LEDBase class. This is the default constructor.
protected LEDBase ( ) : System
return System

Off() public abstract method

Switches the light off.
public abstract Off ( ) : void
return void

On() public abstract method

Switches the light on.
public abstract On ( ) : void
return void

OnStateChanged() protected method

Raises the state changed event.
protected OnStateChanged ( LightStateChangeEventArgs e ) : void
e LightStateChangeEventArgs /// The event arguments. ///
return void

Pulse() public abstract method

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

Pulse() public abstract method

Pulses the state of the LED.
public abstract 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

Toggle() public method

Toggles the state of the LED.
public Toggle ( ) : void
return void