MicroGraphics graphics;
public override Task Initialize()
{
Resolver.Log.Info("Initializing...");
var ch1115 = new Ch1115
(
spiBus: Device.CreateSpiBus(),
chipSelectPin: Device.Pins.D02,
dcPin: Device.Pins.D01,
resetPin: Device.Pins.D00,
width: 128,
height: 64
);
graphics = new MicroGraphics(ch1115);
graphics.CurrentFont = new Font8x8();
return base.Initialize();
}
public override Task Run()
{
graphics.Clear();
graphics.DrawTriangle(10, 10, 50, 50, 10, 50, false);
graphics.DrawRectangle(20, 15, 40, 20, true);
graphics.DrawText(5, 5, "CH1115");
graphics.Show();
return base.Run();
}