ThingPulse / esp8266-oled-ssd1306

Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
https://thingpulse.com
Other
2.01k stars 638 forks source link

Printing text without last pixel position #316

Closed tokra closed 3 years ago

tokra commented 3 years ago

Is there a method like in Adafruit library where u dont need to add cordinates to print string ? I only set position of 1st cursor then called print. It would be very useful to know as not everytime u know position of last printed text cursor. for example when Im printing dots "." in while loop when connecting to wifi. thank you in advance

ThatTSGuy commented 3 years ago

You can use this example for a simple ". . .":

  int i = 0;
  display.drawString(0, 0, "Connecting");
  while (WiFi.status() != 3) {
    if (i > 8) {
      i = 0;
      display.clear();
      display.drawString(0, 0, "Connecting");
      display.display();
    } else {
      display.drawString(i * 8 + 85, 0, ".");
      display.display();
      i++;
      delay(250);
    }
    WiFi.begin("MyNetwork", "MyPass123");
  }