Meadow.Foundation.FeatherWings.CharlieWing
CharlieWing | |
---|---|
Status | |
Source code | GitHub |
Datasheet(s) | GitHub |
NuGet package |
Code Example
CharlieWing charlieWing;
MicroGraphics graphics;
public override Task Initialize()
{
Console.WriteLine("Initialize...");
charlieWing = new CharlieWing(Device.CreateI2cBus());
graphics = new MicroGraphics(charlieWing)
{
CurrentFont = new Font4x8()
};
return Task.CompletedTask;
}
public override Task Run()
{
graphics.Clear();
graphics.DrawText(0, 0, "F7");
graphics.Show();
return Task.CompletedTask;
}
Sample project(s) available on GitHub
Class CharlieWing
Represents an Adafruit CharliePlex 15x7 feather wing
Assembly: CharlieWing.dll
View Source
public class CharlieWing : IPixelDisplay, IDisplay
Implements:
Meadow.Peripherals.Displays.IPixelDisplay
, Meadow.Peripherals.Displays.IDisplay
Properties
ColorMode
Color mode of display
View Source
public ColorMode ColorMode { get; }
Width
Width of display in pixels
View Source
public int Width { get; }
Height
Height of display in pixels
View Source
public int Height { get; }
Frame
The Is31fl3731 active frame
View Source
public byte Frame { get; set; }
PixelBuffer
The pixel buffer that represents the offscreen buffer Not implemented for this driver
View Source
public IPixelBuffer PixelBuffer { get; }
SupportedColorModes
Color modes supported by the device
View Source
public ColorMode SupportedColorModes { get; }
Fields
is31Fl3731
Is31fl3731 object to manage the LEDs
View Source
protected readonly Is31fl3731 is31Fl3731
Methods
Clear(bool)
Clear the display buffer
View Source
public void Clear(bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | updateDisplay | Force 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
public void DrawPixel(int x, int y, Color color)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
Meadow.Color | color | The color to draw normalized to black/off or white/on |
DrawPixel(int, int, bool)
Turn on a LED on (x,y) coordinates
View Source
public void DrawPixel(int x, int y, bool colored)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
System.Boolean | colored | Led is on if true, off if false |
DrawPixel(int, int, byte)
Turn on LED with the specified brightness on (x,y) coordinates
View Source
public void DrawPixel(int x, int y, byte brightness)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
System.Byte | brightness | The led brightness from 0-255 |
InvertPixel(int, int)
Invert the color of the pixel at the given location
View Source
public void InvertPixel(int x, int y)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
WriteBuffer(int, int, IPixelBuffer)
Draw a buffer to the display
View Source
public void WriteBuffer(int x, int y, IPixelBuffer displayBuffer)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
Meadow.Peripherals.Displays.IPixelBuffer | displayBuffer | The display buffer to draw to the CharlieWing |
Fill(Color, bool)
Fill the display buffer to a normalized color
View Source
public void Fill(Color fillColor, bool updateDisplay = false)
Parameters
Type | Name | Description |
---|---|---|
Meadow.Color | fillColor | The clear color which will be normalized to black/off or white/on |
System.Boolean | updateDisplay | Force a display update if true, false to clear the buffer |
Fill(int, int, int, int, Color)
Fill the display
View Source
public void Fill(int x, int y, int width, int height, Color fillColor)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | x | The x position in pixels 0 indexed from the left |
System.Int32 | y | The y position in pixels 0 indexed from the top |
System.Int32 | width | The width to fill in pixels |
System.Int32 | height | The height to fill in pixels |
Meadow.Color | fillColor | The fillColor color which will be normalized to black/off or white/on |
Show()
Update the display from the offscreen buffer
View Source
public void Show()
Show(int, int, int, int)
Update a region of the display from the offscreen buffer
View Source
public void Show(int left, int top, int right, int bottom)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | left | The left bounding position in pixels |
System.Int32 | top | The top bounding position in pixels |
System.Int32 | right | The right bounding position in pixels |
System.Int32 | bottom | The bottom bounding position in pixels |
Show(byte)
Update the display from a specific Is31fl3731 frame
View Source
public void Show(byte frame)
Parameters
Type | Name | Description |
---|---|---|
System.Byte | frame | The frame to show (0-7) |
Implements
Meadow.Peripherals.Displays.IPixelDisplay
Meadow.Peripherals.Displays.IDisplay