Skip to main content

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
TypeName
System.SinglehighBrightness
System.SinglelowBrightness

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
TypeName
System.TimeSpanhighBrightnessDuration
System.TimeSpanlowBrightnessDuration
System.SinglehighBrightness
System.SinglelowBrightness

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
TypeName
System.SinglehighBrightness
System.SinglelowBrightness

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
TypeName
System.TimeSpanpulseDuration
System.SinglehighBrightness
System.SinglelowBrightness

StopAnimation()

Stops any running animations.

View Source
Task StopAnimation()
Returns

System.Threading.Tasks.Task