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
Declaration
public interface IPwmLed

Properties

IsOn

Gets or sets a value indicating whether the LED is on.

View Source
Declaration
bool IsOn { get; set; }

Brightness

Gets the brightness of the LED, controlled by a PWM signal

View Source
Declaration
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
Declaration
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
Declaration
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
Declaration
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
Declaration
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
Declaration
Task StopAnimation()
Returns

System.Threading.Tasks.Task