Skip to main content

Meadow.Foundation.Grove.Displays.OLEDDisplay1_12inch

OLEDDisplay1_12inch
StatusStatus badge: working
Source codeGitHub
NuGet packageNuGet Gallery for Meadow.Foundation.Grove.Displays.OLEDDisplay1_12inch

Code Example

OLEDDisplay1_12inch display;
MicroGraphics graphics;

public override Task Initialize()
{
Resolver.Log.Info("Initialize...");

display = new OLEDDisplay1_12inch(Device.CreateI2cBus(), OLEDDisplayVersion.Version3x);

graphics = new MicroGraphics(display)
{
CurrentFont = new Font8x8(),
Rotation = RotationType._180Degrees
};

return Task.CompletedTask;
}

public override Task Run()
{
graphics.Clear();
graphics.DrawRectangle(0, 0, graphics.Width, graphics.Height, false);
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "SH1107");
graphics.Show();

return Task.CompletedTask;
}

Sample project(s) available on GitHub