DotstarWing dotStarWing;
MicroGraphics graphics;
public override Task Initialize()
{
Console.WriteLine("Initialize...");
var spiBus = Device.CreateSpiBus();
dotStarWing = new DotstarWing(spiBus)
{
Brightness = 0.1f
};
graphics = new MicroGraphics(dotStarWing)
{
CurrentFont = new Font4x6()
};
return Task.CompletedTask;
}
public override Task Run()
{
graphics.Clear();
graphics.DrawRectangle(0, 0, 8, 4, Color.LawnGreen, true);
graphics.DrawRectangle(2, 2, 8, 4, Color.Cyan, true);
graphics.DrawText(0, 0, "F7", Color.White);
graphics.Show();
return Task.CompletedTask;
}