Interface IRgbPwmLed
Defines a Pulse-Width-Modulation (PWM) controlled RGB LED.
Assembly: Meadow.Contracts.dll
View Source
public interface IRgbPwmLed
Properties
IsOn
Gets or sets a value indicating whether the LED is on.
View Source
bool IsOn { get; set; }
Brightness
The brightness value assigned to the LED
View Source
float Brightness { get; }
Methods
SetColor(Color, float)
Sets the current color of the LED
View Source
void SetColor(Color color, float brightness = 1)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The LED color |
System.Single | brightness | Valid values are from 0 to 1, inclusive |
StopAnimation()
Stops the current LED animation
View Source
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
Task StartBlink(float highBrightness = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartBlink(Color color, float highBrightness = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The LED color |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartBlink(TimeSpan onDuration, TimeSpan offDuration, float highBrightness = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | onDuration | The duration the LED stays on |
System.TimeSpan | offDuration | The duration the LED stays off |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartBlink(Color color, TimeSpan onDuration, TimeSpan offDuration, float highBrightness = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The LED color |
System.TimeSpan | onDuration | The duration the LED stays on |
System.TimeSpan | offDuration | The duration the LED stays off |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartPulse(float highBrightness = 1, float lowBrightness = 0.15)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartPulse(Color color, float highBrightness = 1, float lowBrightness = 0.15)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The LED color |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartPulse(Color color, TimeSpan pulseDuration, float highBrightness = 1, float lowBrightness = 0.15)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | color | The LED color |
System.TimeSpan | pulseDuration | The pulse animation duration |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The 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
Task StartPulse(TimeSpan pulseDuration, float highBrightness = 1, float lowBrightness = 0.15)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | pulseDuration | The pulse animation duration |
System.Single | highBrightness | The maximum brightness of the animation |
System.Single | lowBrightness | The minimum brightness of the animation |