Interface IPwmLed
Defines a Light Emitting Diode (LED) controlled by a pulse-width-modulation (PWM) signal to limit current.
Assembly: Meadow.Contracts.dll
View Source
public interface IPwmLed : ILed
Properties
Brightness
Gets the brightness of the LED, controlled by a PWM signal
View Source
float Brightness { get; }
Methods
StartBlink(float, float)
Start a Blink animation which sets the brightness of the LED alternating between a low and high brightness setting.
View Source
Task StartBlink(float highBrightness, float lowBrightness)
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(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 highBrightnessDuration, TimeSpan lowBrightnessDuration, float highBrightness = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name | Description |
---|---|---|
System.TimeSpan | highBrightnessDuration | The duration the LED stays in high brightness |
System.TimeSpan | lowBrightnessDuration | The duration the LED stays in low brightness |
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.
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(TimeSpan, float, float)
Start the Pulse animation which gradually alternates the brightness of the LED between a low and high brightness setting, using the durations 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 |
SetBrightness(float)
Set the LED brightness
View Source
void SetBrightness(float brightness)
Parameters
Type | Name | Description |
---|---|---|
System.Single | brightness | Valid values are from 0 to 1, inclusive |