void TestRawDisplayAPI() { display.Clear(true); for (int i = 0; i < 30; i++) { display.DrawPixel(i, i, true); display.DrawPixel(30 + i, i, true); display.DrawPixel(60 + i, i, true); } display.Show(); }
public MeadowApp() { //CreateSpiDisplay(); CreateI2CDisplay(); Console.WriteLine("Fill display"); for (int x = 0; x < display.Width; x++) { for (int y = 0; y < display.Height; y++) { display.DrawPixel(x, y, true); } } display.Show(); Thread.Sleep(2000); /* Console.WriteLine("Test display API"); * TestRawDisplayAPI(); * Thread.Sleep(3000); */ Console.WriteLine("Create Graphics Library"); TestDisplayGraphicsAPI(); Thread.Sleep(2000); Console.WriteLine("Test Inversion"); for (int x = 0; x < 64; x++) { for (int y = 0; y < 12; y++) { display.InvertPixel(x, y); } } display.Show(); Thread.Sleep(3000); Console.WriteLine("Check offsets"); graphics.Clear(); graphics.DrawRectangle(0, 0, (int)display.Width, (int)display.Height, true, false); graphics.Show(); Thread.Sleep(3000); for (int x = 0; x < display.Width; x++) { Console.WriteLine($"X: {x}"); graphics.Clear(); graphics.DrawLine(x, 0, x, (int)display.Height - 1, true); graphics.Show(); Thread.Sleep(50); } for (int y = 0; y < display.Height; y++) { Console.WriteLine($"Y: {y}"); graphics.Clear(); graphics.DrawLine(0, y, (int)display.Width - 1, y, true); graphics.Show(); Thread.Sleep(50); } Thread.Sleep(Timeout.Infinite); }