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 : ILed

Properties

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, float lowBrightness)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe 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
Declaration
Task StartBlink(TimeSpan highBrightnessDuration, TimeSpan lowBrightnessDuration, float highBrightness = 1, float lowBrightness = 0)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanhighBrightnessDurationThe duration the LED stays in high brightness
System.TimeSpanlowBrightnessDurationThe duration the LED stays in low brightness
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe 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
Declaration
Task StartPulse(float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe 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
Declaration
Task StartPulse(TimeSpan pulseDuration, float highBrightness = 1, float lowBrightness = 0.15)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanpulseDurationThe pulse animation duration
System.SinglehighBrightnessThe maximum brightness of the animation
System.SinglelowBrightnessThe minimum brightness of the animation

SetBrightness(float)

Set the LED brightness

View Source
Declaration
void SetBrightness(float brightness)
Parameters
TypeNameDescription
System.SinglebrightnessValid values are from 0 to 1, inclusive