Skip to main content

Interface IRgbPwmLed

Defines a Pulse-Width-Modulation (PWM) controlled RGB LED.

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

Properties

IsOn

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

View Source
Declaration
bool IsOn { get; set; }

Brightness

The brightness value assigned to the LED

View Source
Declaration
float Brightness { get; }

Methods

SetColor(Color, float)

Sets the current color of the LED

View Source
Declaration
void SetColor(Color color, float brightness = 1)
Parameters
TypeNameDescription
Meadow.ColorcolorThe LED color
System.SinglebrightnessValid values are from 0 to 1, inclusive

StopAnimation()

Stops the current LED animation

View Source
Declaration
Task StopAnimation()
Returns

System.Threading.Tasks.Task

StartBlink(float, float)

Start the Blink animation which sets the brightness of the LED alternating between a low and high brightness on an interval of 1 second (500ms on, 500ms off)

View Source
Declaration
Task StartBlink(float highBrightness = 1, float lowBrightness = 0)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartBlink(Color, float, float)

Start the Blink animation which sets the brightness of the LED alternating between a low and high brightness on an interval of 1 second (500ms on, 500ms off)

View Source
Declaration
Task StartBlink(Color color, float highBrightness = 1, float lowBrightness = 0)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.ColorcolorThe LED color
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartBlink(TimeSpan, TimeSpan, float, float)

Start the Blink animation which sets the brightness of the LED alternating between a low and high brightness setting, using the durations provided.

View Source
Declaration
Task StartBlink(TimeSpan onDuration, TimeSpan offDuration, float highBrightness = 1, float lowBrightness = 0)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanonDurationThe duration the LED stays on
System.TimeSpanoffDurationThe duration the LED stays off
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartBlink(Color, TimeSpan, TimeSpan, float, float)

Start the Blink animation which sets the brightness of the LED alternating between a low and high brightness setting, using the durations provided

View Source
Declaration
Task StartBlink(Color color, TimeSpan onDuration, TimeSpan offDuration, float highBrightness = 1, float lowBrightness = 0)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.ColorcolorThe LED color
System.TimeSpanonDurationThe duration the LED stays on
System.TimeSpanoffDurationThe duration the LED stays off
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartPulse(float, float)

Start the Pulse animation which gradually alternates the brightness of the LED between a low and high brightness setting with a cycle time of 600ms

View Source
Declaration
Task StartPulse(float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartPulse(Color, float, float)

Start the Pulse animation which gradually alternates the brightness of the LED between a low and high brightness setting with a cycle time of 600ms

View Source
Declaration
Task StartPulse(Color color, float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.ColorcolorThe LED color
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartPulse(Color, TimeSpan, float, float)

Start the Pulse animation which gradually alternates the brightness of the LED between a low and high brightness setting, using the duration provided and especified color

View Source
Declaration
Task StartPulse(Color color, TimeSpan pulseDuration, float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
Meadow.ColorcolorThe LED color
System.TimeSpanpulseDurationThe pulse animation duration
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

StartPulse(TimeSpan, float, float)

Start the Pulse animation which gradually alternates the brightness of the LED between a low and high brightness setting, using the duration provided

View Source
Declaration
Task StartPulse(TimeSpan pulseDuration, float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanpulseDurationThe pulse animation duration
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation