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

privateWs2812 neoPixels;

privatereadonlyint ledCount =24;

publicoverrideTaskInitialize()
{
var spiBus = Device.CreateSpiBus();
neoPixels =newWs2812(spiBus, ledCount);

returnbase.Initialize();
}

publicoverrideasyncTaskRun()
{
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

close