| void Display::showBrand() { | void Display::showBrand() { | ||||
| ssd1306.clearDisplay(); | ssd1306.clearDisplay(); | ||||
| ssd1306.drawBitmap(0, 0, epd_bitmap_SFTools_Logo, 128, 34, SSD1306_WHITE); | 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(); | display(); | ||||
| } | } | ||||
| void Display::showInitialization() { | void Display::showInitialization() { | ||||
| ssd1306.clearDisplay(); | 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++) { | for (int i = 0; i < 6; i++) { | ||||
| ssd1306.print(s); | |||||
| g = &gauge[0]; | |||||
| u8g2_gfx.print(g); | |||||
| display(); | display(); | ||||
| delay(500); | delay(500); | ||||
| if (i < 5) { | |||||
| ssd1306.print(s + ". "); | |||||
| if (i < 4) { | |||||
| gauge = ". "; | |||||
| g = &gauge[0]; | |||||
| } else { | } else { | ||||
| ssd1306.println(s + "."); | |||||
| gauge = "."; | |||||
| g = &gauge[0]; | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| void Display::drawStatusText(String txt) { | void Display::drawStatusText(String txt) { | ||||
| char *s; | |||||
| s = &txt[0]; | |||||
| char *s = &txt[0]; | |||||
| int16_t w = 0; | int16_t w = 0; | ||||
| u8g2_gfx.setFont(u8g2_font_helvR08_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall | u8g2_gfx.setFont(u8g2_font_helvR08_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall | ||||
| } | } | ||||
| void Display::drawConfigText(String txt) { | void Display::drawConfigText(String txt) { | ||||
| char *s; | |||||
| s = &txt[0]; | |||||
| char *s = &txt[0]; | |||||
| int16_t w = 0, h = 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 | u8g2_gfx.setFont(u8g2_font_helvB12_tf); // select u8g2 font from here: https://github.com/olikraus/u8g2/wiki/fntlistall | ||||
| } | } | ||||
| void Display::drawConfigOption(String txt) { | void Display::drawConfigOption(String txt) { | ||||
| char *s; | |||||
| s = &txt[0]; | |||||
| char *s = &txt[0]; | |||||
| int16_t w = 0, h = 0; | int16_t w = 0, h = 0; | ||||
| u8g2_gfx.setFont(u8g2_font_helvB12_tf); | u8g2_gfx.setFont(u8g2_font_helvB12_tf); |