Skip to main content

Meadow.Foundation.FeatherWings.NeoPixelWing

NeoPixelWing
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.FeatherWings.NeoPixelWing

Code Example

NeoPixelWing neoWing;
MicroGraphics graphics;

public override Task Initialize()
{
Console.WriteLine("Initializing ...");

neoWing = new NeoPixelWing(Device.CreateSpiBus());

graphics = new MicroGraphics(neoWing);

return Task.CompletedTask;
}

public override Task Run()
{
graphics.Clear();

graphics.DrawRectangle(0, 0, 8, 4, false);

graphics.Show();

return Task.CompletedTask;
}

Sample project(s) available on GitHub

Class NeoPixelWing

Represents Adafruits NeoPixel FeatherWing

Assembly: NeoPixelWing.dll
View Source
Declaration
public class NeoPixelWing : IPixelDisplay, IDisplay

Implements:
Meadow.Peripherals.Displays.IPixelDisplay, Meadow.Peripherals.Displays.IDisplay

Properties

ColorMode

Color mode of display

View Source
Declaration
public ColorMode ColorMode { get; }

Width

Width of display in pixels

View Source
Declaration
public int Width { get; }

Height

Height of display in pixels

View Source
Declaration
public int Height { get; }

PixelBuffer

The pixel buffer that represents the offscreen buffer Not implemented for this driver

View Source
Declaration
public IPixelBuffer PixelBuffer { get; protected set; }

SupportedColorModes

Color modes supported by the device

View Source
Declaration
public ColorMode SupportedColorModes { get; }

Leds

Returns Ws2812 instance

View Source
Declaration
public Ws2812 Leds { get; protected set; }

Methods

Clear(bool)

Clear the display buffer

View Source
Declaration
public void Clear(bool updateDisplay = false)
Parameters
TypeNameDescription
System.BooleanupdateDisplayForce a display update if true, false to clear the buffer

DrawPixel(int, int, Color)

Turn on an RGB LED with the specified color on (x,y) coordinates

View Source
Declaration
public void DrawPixel(int x, int y, Color color)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels 0 indexed from the left
System.Int32yThe y position in pixels 0 indexed from the top
Meadow.ColorcolorThe color to draw normalized to black/off or white/on

DrawPixel(int, int, bool)

Turn on a LED on (x,y) coordinates

View Source
Declaration
public void DrawPixel(int x, int y, bool colored)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels 0 indexed from the left
System.Int32yThe y position in pixels 0 indexed from the top
System.BooleancoloredLed is on if true, off if false

InvertPixel(int, int)

Invert the color of the pixel at the given location

View Source
Declaration
public void InvertPixel(int x, int y)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels 0 indexed from the left
System.Int32yThe y position in pixels 0 indexed from the top

WriteBuffer(int, int, IPixelBuffer)

Draw a buffer to the display

View Source
Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels 0 indexed from the left
System.Int32yThe y position in pixels 0 indexed from the top
Meadow.Peripherals.Displays.IPixelBufferdisplayBufferThe display buffer to draw to the CharlieWing

Fill(Color, bool)

Fill the display buffer to a normalized color

View Source
Declaration
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
TypeNameDescription
Meadow.ColorfillColorThe clear color which will be normalized to black/off or white/on
System.BooleanupdateDisplayForce a display update if true, false to clear the buffer

Fill(int, int, int, int, Color)

Fill the display

View Source
Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
TypeNameDescription
System.Int32xThe x position in pixels 0 indexed from the left
System.Int32yThe y position in pixels 0 indexed from the top
System.Int32widthThe width to fill in pixels
System.Int32heightThe height to fill in pixels
Meadow.ColorfillColorThe fillColor color which will be normalized to black/off or white/on

Show()

Update the display from the offscreen buffer

View Source
Declaration
public void Show()

Show(int, int, int, int)

Update a region of the display from the offscreen buffer

View Source
Declaration
public void Show(int left, int top, int right, int bottom)
Parameters
TypeNameDescription
System.Int32leftThe left bounding position in pixels
System.Int32topThe top bounding position in pixels
System.Int32rightThe right bounding position in pixels
System.Int32bottomThe bottom bounding position in pixels

Implements

  • Meadow.Peripherals.Displays.IPixelDisplay
  • Meadow.Peripherals.Displays.IDisplay