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
Properties
IsOn
Gets or sets a value indicating whether the LED is on.
View Source
bool IsOn { get; set; }
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 = 1, float lowBrightness = 0)
Returns
System.Threading.Tasks.Task
Parameters
Type | Name |
---|---|
System.Single | highBrightness |
System.Single | lowBrightness |
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 |
---|---|
System.TimeSpan | highBrightnessDuration |
System.TimeSpan | lowBrightnessDuration |
System.Single | highBrightness |
System.Single | lowBrightness |
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 |
---|---|
System.Single | highBrightness |
System.Single | lowBrightness |
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 |
---|---|
System.TimeSpan | pulseDuration |
System.Single | highBrightness |
System.Single | lowBrightness |
StopAnimation()
Stops any running animations.
View Source
Task StopAnimation()
Returns
System.Threading.Tasks.Task