async Task Start() { while (true) { DateTime clock = DateTime.Now.AddHours(-8); graphics.Clear(); graphics.DrawText(0, 1, $"{clock:hh}"); graphics.DrawText(0, 9, $"{clock:mm}"); graphics.DrawText(0, 17, $"{clock:ss}"); graphics.DrawText(0, 25, $"{clock:tt}"); if (showDate) { graphics.Clear(); graphics.DrawText(0, 1, $"{clock:dd}"); graphics.DrawText(0, 9, $"{clock:MM}"); graphics.DrawText(0, 17, $"{clock:yy}"); graphics.DrawHorizontalLine(0, 24, 7, true); var temperature = await analogTemperature.Read(); graphics.DrawText(0, 26, $"{(int) temperature.Celsius}"); } graphics.Show(); Thread.Sleep(1000); } }
void DrawTitleAndFrame() { graphics.Clear(); graphics.DrawRectangle(0, 0, 240, 240); graphics.DrawText(24, 15, "Morse Code Coach"); graphics.DrawHorizontalLine(24, 41, 196, Color.White); graphics.Show(); }