public static void DebugPrint(string str) { for (int i = 0; i < 8; i++) { Oled.DrawString(1, i, " "); } Oled.DrawString(1, _lineNum++, "*" + str, false); Oled.Refresh(); if (_lineNum == 8) { _lineNum = 0; } Debug.Print(DateTime.Now + ": " + str); }
public static void DisplaySpaceInvaders() { var random = new Random((int)DateTime.Now.Ticks); var cropCircles = new ArrayList(); var maxSpaceInvaders = 5; for (var count = 0; count < maxSpaceInvaders; count++) { cropCircles.Add(new CropCircleLocation(random, AdaFruitSSD1306.Width, AdaFruitSSD1306.Height)); } while (true) { oled.ClearScreen(); foreach (CropCircleLocation loc in cropCircles) { loc.Move(AdaFruitSSD1306.Width, AdaFruitSSD1306.Height); oled.DrawBitmap(loc.x, loc.y, ref spaceInvader, 16, 16, AdaFruitSSD1306.Color.White); } oled.Refresh(); } }