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 : IPwmLed, IRgbLed, ILed

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

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(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(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 specified 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