Skip to main content

Class Led

Utility functions to provide blinking for Led

Assembly: Meadow.Foundation.dll
View Source
public class Led : ILed, IDisposable

Implements:
Meadow.Peripherals.Leds.ILed, System.IDisposable

Properties

IsOn

Turns on LED with current color or turns it off

View Source
public bool IsOn { get; set; }

Port

Gets the port that is driving the LED

View Source
protected IDigitalOutputPort Port { get; set; }

IsDisposed

Is the object disposed

View Source
public bool IsDisposed { get; }

Methods

StopAnimation()

Stops the current LED animation

View Source
public Task StopAnimation()
Returns

System.Threading.Tasks.Task

Start the Blink animation which sets turns the LED on and off on an interval of 1 second (500ms on, 500ms off)

View Source
public Task StartBlink()
Returns

System.Threading.Tasks.Task

StartBlink(TimeSpan, TimeSpan)

Start the Blink animation which sets turns the LED on and off with the specified durations

View Source
public Task StartBlink(TimeSpan onDuration, TimeSpan offDuration)
Returns

System.Threading.Tasks.Task

Parameters
TypeNameDescription
System.TimeSpanonDurationThe duration the LED stays on
System.TimeSpanoffDurationThe duration the LED stays off

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
public void Dispose()

Dispose(bool)

Dispose of the object

View Source
protected virtual void Dispose(bool disposing)
Parameters
TypeNameDescription
System.BooleandisposingIs disposing

Implements

  • Meadow.Peripherals.Leds.ILed
  • System.IDisposable