Skip to main content

Meadow.Foundation.Leds.Ws2812

Ws2812
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Leds.Ws2812

Code Example

private Ws2812 neoPixels;

private readonly int ledCount = 24;

public override Task Initialize()
{
var spiBus = Device.CreateSpiBus();
neoPixels = new Ws2812(spiBus, ledCount);

return base.Initialize();
}

public override async Task Run()
{
while (true)
{
for (int i = 0; i < neoPixels.NumberOfLeds; i++)
{
neoPixels.SetAllLeds(Color.Black);
neoPixels.SetLed(i, Color.Blue);
neoPixels.Show();
await Task.Delay(100);
}
}
}

Sample project(s) available on GitHub