Skip to main content

Interface IRgbLed

Defines an RGB Light Emitting Diode (LED).

Assembly: Meadow.Contracts.dll
View Source
Declaration
public interface IRgbLed

Properties

IsOn

Gets or sets a value indicating whether the LED is on.

View Source
Declaration
bool IsOn { get; set; }

Methods

SetColor(RgbLedColors)

Sets the current color of the LED.

View Source
Declaration
void SetColor(RgbLedColors color)
Parameters
TypeNameDescription
Meadow.Peripherals.Leds.RgbLedColorscolorThe color value

StopAnimation()

Stops the current LED animation

View Source
Declaration
Task StopAnimation()
Returns

System.Threading.Tasks.Task

Start the Blink animation which sets turns the LED on and off on an interval of 1 second (500ms on, 500ms off)

View Source
Declaration
Task StartBlink()
Returns

System.Threading.Tasks.Task

StartBlink(RgbLedColors)

Start the Blink animation which sets turns the LED on and off on an interval of 1 second (500ms on, 500ms off)

View Source
Declaration
Task StartBlink(RgbLedColors color)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Peripherals.Leds.RgbLedColorscolorThe LED color

StartBlink(TimeSpan, TimeSpan)

Start the Blink animation which sets turns the LED on and off with the specified durations and current color

View Source
Declaration
Task StartBlink(TimeSpan onDuration, TimeSpan offDuration)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanonDurationThe duration the LED stays on
System.TimeSpanoffDurationThe duration the LED stays off

StartBlink(RgbLedColors, TimeSpan, TimeSpan)

Start the Blink animation which sets turns the LED on and off with the specified durations and color

View Source
Declaration
Task StartBlink(RgbLedColors color, TimeSpan onDuration, TimeSpan offDuration)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.Peripherals.Leds.RgbLedColorscolorThe LED color
System.TimeSpanonDurationThe duration the LED stays on
System.TimeSpanoffDurationThe duration the LED stays off