public static void Main() { Debug.WriteLine("[HellOled] : a advanced hello word with the embedded OLED screen."); //OLED INIT var heltec = new Lora.GXM.LoraTest.HeltecOled(); heltec.Begin(); heltec.Display.SetBrightness(180); heltec.Display.FlipScreenVertically(); heltec.Display.CurrentColor = OledColor.White; heltec.Display.CurrentFont = FontArialMTPlain10.GetFont(); heltec.Display.Clear(); heltec.Display.DrawString(0, 0, "Booting........"); heltec.Display.RefreshDisplay(); Thread.Sleep(2000); //Radio INIT heltec.Display.DrawString(0, 10, "Radio Initializing!"); heltec.Display.RefreshDisplay(); initRadio(heltec.Display); heltec.Display.DrawString(0, 20, "Radio Initialized!"); heltec.Display.RefreshDisplay(); //led.Write(PinValue.Low); Thread.Sleep(5000); }
static void DemoScreen4(SSD1306Driver oledScreen) { oledScreen.Clear(); oledScreen.CurrentFont = FontArialMTPlain10.GetFont(); oledScreen.DrawHorizontalLine(0, 32, 128); oledScreen.DrawVerticalLine(64, 0, 64); oledScreen.CurrentTextAlignement = TextAlignment.Left; oledScreen.DrawString(0, 0, "DrawString()\rLine 1\nLine 2\r\nLine 3"); oledScreen.CurrentTextAlignement = TextAlignment.Right; oledScreen.DrawString(128, 0, "DrawString()\rLine 1\nLine 2\r\nLine 3"); oledScreen.CurrentTextAlignement = TextAlignment.Center; oledScreen.DrawString(64, 0, "< >\r-< >-\roO0[]0Oo\r/ \\\r\\_ _/"); }
static void DemoScreen3(SSD1306Driver oledScreen) { oledScreen.Clear(); oledScreen.CurrentTextAlignement = TextAlignment.Left; oledScreen.CurrentFont = FontArialMTPlain10.GetFont(); oledScreen.DrawString(1, 0, "NiCo"); oledScreen.CurrentFont = FontArialMTPlain16.GetFont(); oledScreen.DrawString(1, 11, "nIc0"); oledScreen.CurrentFont = FontArialMTPlain24.GetFont(); oledScreen.DrawString(1, 30, "N1co"); }
public static void Main() { Debug.WriteLine("[HellOled] : a advanced hello word with the embedded OLED screen."); var heltec = new HeltecOled(); heltec.Begin(); heltec.Display.SetBrightness(180); heltec.Display.FlipScreenVertically(); heltec.Display.CurrentColor = OledColor.White; int counter = 0; GpioController gpioc = new GpioController(); GpioPin led = gpioc.OpenPin(OnBoardDevicePortNumber.Led, PinMode.Output); led.Write(PinValue.Low); wifiLogo = XBMSamples.GetWifiLogoXBM(); nanofLogo = XBMSamples.GetNanoFrameworkXBM(); heltec.Display.CurrentFont = FontArialMTPlain10.GetFont(); while (true) { switch (counter) { case 0: heltec.Display.Clear(); heltec.Display.TestFill(0); break; case 1: heltec.Display.Clear(); DemoGeometry(heltec.Display); break; case 2: heltec.Display.Clear(); DemoScreen2(heltec.Display); break; case 3: DemoScreen3(heltec.Display); break; case 4: DemoScreen4(heltec.Display); break; default: counter = -1; // there is the ++ at the end of loop break; } heltec.Display.RefreshDisplay(); led.Toggle(); Thread.Sleep(1000); counter++; } }