Skip to main content

Class Led

Utility functions to provide blinking for Led

Assembly: Meadow.Foundation.dll
View Source
Declaration
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
Declaration
public bool IsOn { get; set; }

Port

Gets the port that is driving the LED

View Source
Declaration
protected IDigitalOutputPort Port { get; set; }

IsDisposed

Is the object disposed

View Source
Declaration
public bool IsDisposed { get; }

Methods

StopAnimation()

Stops the current LED animation

View Source
Declaration
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
Declaration
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
Declaration
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
Declaration
public void Dispose()

Dispose(bool)

Dispose of the object

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

Implements

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