| @@ -40,37 +40,46 @@ void Display::clearDisplay() { | |||
| void Display::showBrand() { | |||
| ssd1306.clearDisplay(); | |||
| ssd1306.drawBitmap(0, 0, epd_bitmap_SFTools_Logo, 128, 34, SSD1306_WHITE); | |||
| ssd1306.setFont(&titillium_web_semibold12pt7b); | |||
| ssd1306.setTextSize(1); | |||
| ssd1306.setTextColor(SSD1306_WHITE); | |||
| uint16_t w = 0, h = 0; | |||
| calculateWH("Fraestisch N172", w, h); | |||
| ssd1306.setCursor((SCREEN_WIDTH - w) / 2, 63 - (30 - h) / 2); | |||
| ssd1306.println("Fraestisch N172"); | |||
| char *s = &String("Frästisch N172")[0]; | |||
| int16_t w = 0, h = 0; | |||
| u8g2_gfx.setFont(u8g2_font_helvB12_tf); | |||
| w = u8g2_gfx.getUTF8Width(s); | |||
| h = u8g2_gfx.getFontAscent() - u8g2_gfx.getFontDescent(); | |||
| u8g2_gfx.setForegroundColor(SSD1306_WHITE); | |||
| u8g2_gfx.setCursor((SCREEN_WIDTH - w) / 2, 63 - (30 - h) / 2); | |||
| u8g2_gfx.println(F(s)); | |||
| display(); | |||
| } | |||
| void Display::showInitialization() { | |||
| ssd1306.clearDisplay(); | |||
| ssd1306.setFont(&titillium_web_semibold12pt7b); | |||
| ssd1306.setTextSize(1); | |||
| ssd1306.setTextColor(SSD1306_WHITE); | |||
| uint16_t w = 0, h = 0; | |||
| calculateWH("Initialisieren", w, h); | |||
| ssd1306.setCursor((SCREEN_WIDTH - w) / 2, 30); | |||
| ssd1306.println("Initialisieren"); | |||
| calculateWH(". . . . .", w, h); | |||
| ssd1306.setCursor((SCREEN_WIDTH - w) / 2, 50); | |||
| String s = ""; | |||
| char *s = &String("Initialisieren")[0]; | |||
| int16_t w = 0; | |||
| u8g2_gfx.setFont(u8g2_font_helvB12_tf); | |||
| w = u8g2_gfx.getUTF8Width(s); | |||
| Serial.println("w: " + String(w)); | |||
| u8g2_gfx.setForegroundColor(SSD1306_WHITE); | |||
| u8g2_gfx.setCursor((SCREEN_WIDTH - w) / 2, 30); | |||
| u8g2_gfx.println(F(s)); | |||
| char *g; | |||
| w = u8g2_gfx.getUTF8Width(". . . . ."); | |||
| Serial.println("w: " + String(w)); | |||
| u8g2_gfx.setCursor((SCREEN_WIDTH - w) / 2, 50); | |||
| String gauge = ""; | |||
| for (int i = 0; i < 6; i++) { | |||
| ssd1306.print(s); | |||
| g = &gauge[0]; | |||
| u8g2_gfx.print(g); | |||
| display(); | |||
| delay(500); | |||
| if (i < 5) { | |||
| ssd1306.print(s + ". "); | |||
| if (i < 4) { | |||
| gauge = ". "; | |||
| g = &gauge[0]; | |||
| } else { | |||
| ssd1306.println(s + "."); | |||
| gauge = "."; | |||
| g = &gauge[0]; | |||
| } | |||
| } | |||
| } | |||
| @@ -119,8 +128,7 @@ void Display::calculateWH(String units, uint16_t &w, uint16_t &h) { | |||
| void Display::drawStatusText(String txt) { | |||
| char *s; | |||
| s = &txt[0]; | |||
| char *s = &txt[0]; | |||
| int16_t w = 0; | |||
| u8g2_gfx.setFont(u8g2_font_helvR08_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall | |||
| @@ -130,8 +138,7 @@ void Display::drawStatusText(String txt) { | |||
| } | |||
| void Display::drawConfigText(String txt) { | |||
| char *s; | |||
| s = &txt[0]; | |||
| char *s = &txt[0]; | |||
| int16_t w = 0, h = 0; | |||
| u8g2_gfx.setFont(u8g2_font_helvB12_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall | |||
| @@ -142,8 +149,7 @@ void Display::drawConfigText(String txt) { | |||
| } | |||
| void Display::drawConfigOption(String txt) { | |||
| char *s; | |||
| s = &txt[0]; | |||
| char *s = &txt[0]; | |||
| int16_t w = 0, h = 0; | |||
| u8g2_gfx.setFont(u8g2_font_helvB12_tf); | |||