Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Characteristic Locus
Inheritance object > NeoPixelWing
Implements IGraphicsDisplay
Inherited Members object.Equals(object) object.Equals(object, object) object.GetHashCode() object.GetType() object.MemberwiseClone() object.ReferenceEquals(object, object) object.ToString()
Namespace Meadow.Foundation.FeatherWings
Assembly NeoPixelWing.dll

Syntax

public class NeoPixelWing : IGraphicsDisplay

Constructors

NeoPixelWing(ISpiBus)

Creates a NeoPixelWing driver instance

Declaration
public NeoPixelWing(ISpiBus spiBus)

Parameters

Type Name Description
ISpiBus spiBus

The SPI bus connected to the wing

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Properties

ColorMode

Color mode of display

Declaration
public ColorMode ColorMode { get; }

Property Value

Type Description
ColorMode

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Height

Height of display in pixels

Declaration
public int Height { get; }

Property Value

Type Description
int

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Leds

Returns Ws2812 instance

Declaration
public Ws2812 Leds { get; protected set; }

Property Value

Type Description
Ws2812

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

PixelBuffer

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

Declaration
public IPixelBuffer PixelBuffer { get; protected set; }

Property Value

Type Description
IPixelBuffer

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

SupportedColorModes

Color modes supported by the device

Declaration
public ColorMode SupportedColorModes { get; }

Property Value

Type Description
ColorMode

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Width

Width of display in pixels

Declaration
public int Width { get; }

Property Value

Type Description
int

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Methods

Clear(bool)

Clear the display buffer

Declaration
public void Clear(bool updateDisplay = false)

Parameters

Type Name Description
bool updateDisplay

Force a display update if true, false to clear the buffer

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

DrawPixel(int, int, Color)

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

Declaration
public void DrawPixel(int x, int y, Color color)

Parameters

Type Name Description
int x

The x position in pixels 0 indexed from the left

int y

The y position in pixels 0 indexed from the top

Color color

The color to draw normalized to black/off or white/on

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

DrawPixel(int, int, bool)

Turn on a LED on (x,y) coordinates

Declaration
public void DrawPixel(int x, int y, bool colored)

Parameters

Type Name Description
int x

The x position in pixels 0 indexed from the left

int y

The y position in pixels 0 indexed from the top

bool colored

Led is on if true, off if false

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Fill(Color, bool)

Fill the display buffer to a normalized color

Declaration
public void Fill(Color fillColor, bool updateDisplay = false)

Parameters

Type Name Description
Color fillColor

The clear color which will be normalized to black/off or white/on

bool updateDisplay

Force a display update if true, false to clear the buffer

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

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

Fill the display

Declaration
public void Fill(int x, int y, int width, int height, Color fillColor)

Parameters

Type Name Description
int x

The x position in pixels 0 indexed from the left

int y

The y position in pixels 0 indexed from the top

int width

The width to fill in pixels

int height

The height to fill in pixels

Color fillColor

The fillColor color which will be normalized to black/off or white/on

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

InvertPixel(int, int)

Invert the color of the pixel at the given location

Declaration
public void InvertPixel(int x, int y)

Parameters

Type Name Description
int x

The x position in pixels 0 indexed from the left

int y

The y position in pixels 0 indexed from the top

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Show()

Update the display from the offscreen buffer

Declaration
public void Show()

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

Show(int, int, int, int)

Update a region of the display from the offscreen buffer

Declaration
public void Show(int left, int top, int right, int bottom)

Parameters

Type Name Description
int left

The left bounding position in pixels

int top

The top bounding position in pixels

int right

The right bounding position in pixels

int bottom

The bottom bounding position in pixels

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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

WriteBuffer(int, int, IPixelBuffer)

Draw a buffer to the display

Declaration
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)

Parameters

Type Name Description
int x

The x position in pixels 0 indexed from the left

int y

The y position in pixels 0 indexed from the top

IPixelBuffer displayBuffer

The display buffer to draw to the CharlieWing

Remarks

NeoPixelWing
Status Status badge: working
Source code GitHub
NuGet package NuGet 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