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 DisplayText() { oled.ClearScreen(); int line = 1; oled.DrawString(0, line++, "######################"); oled.DrawString(0, line++, " Ada Fruit OLED"); oled.DrawString(0, line++, " SSD1306 Display"); oled.DrawString(0, line++, " & netduino helpers"); oled.DrawString(0, line++, " by Fabien Royer"); oled.DrawString(0, line++, " http://codeplex.com"); oled.DrawString(0, line++, "######################"); oled.Refresh(); Thread.Sleep(1000); }
public static void Main() { var oled = new AdaFruitSSD1306( CHIPSELECT: Pins.GPIO_PIN_D10, RESET: Pins.GPIO_PIN_D9, DC: Pins.GPIO_PIN_D8, CLOCK: Pins.GPIO_PIN_D13, DATA: Pins.GPIO_PIN_D11); oled.Select(true); oled.Initialize(); while (true) { oled.Clear(); oled.DrawBitmap(0, 0, ref netduino, 128, 64, AdaFruitSSD1306.Color.WHITE); oled.Display(); oled.Clear(); int line = 1; oled.DrawString(0, line++, "######################"); oled.DrawString(0, line++, " Ada Fruit OLED"); oled.DrawString(0, line++, " SSD1306 Display"); oled.DrawString(0, line++, " & netduino helpers"); oled.DrawString(0, line++, " by Fabien Royer"); oled.DrawString(0, line++, " http://codeplex.com"); oled.DrawString(0, line++, "######################"); oled.Display(); } //oled.Select(false); }