Files
Arduino/WeatherPredictor/display_ui.cpp
T
oskarvitaliiandClaude Opus 4.8 906adaddfe feat: TFT display init and splash screen
Landscape 160x80 (rotation 3, no invert) per this panel.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 19:39:13 +07:00

28 lines
828 B
C++

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#include <SPI.h>
#include "config.h"
#include "display_ui.h"
static Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS, TFT_DC, TFT_RST);
void displayBegin() {
pinMode(TFT_BLK, OUTPUT);
digitalWrite(TFT_BLK, HIGH); // backlight on
tft.initR(INITR_MINI160x80); // 0.96" 80x160 ST7735S
tft.invertDisplay(false); // this panel needs inversion; flip if colours look wrong
tft.setRotation(3); // portrait, 80 wide x 160 tall
tft.fillScreen(ST77XX_BLACK);
}
void displaySplash(const char* line1, const char* line2) {
tft.fillScreen(ST77XX_BLACK);
tft.setTextColor(ST77XX_WHITE);
tft.setTextSize(2);
tft.setCursor(4, 40);
tft.print(line1);
tft.setTextSize(1);
tft.setCursor(4, 70);
tft.print(line2);
}