#include // Hardware-specific library #include TFT_eSPI tft = TFT_eSPI(); void setup() { tft.init(); tft.setRotation(0); drawUI(26, 60); // 只画一次 } void loop() { // 暂时不要反复刷新 } void drawUI(float temp, int hum) { tft.fillScreen(TFT_BLACK); tft.setTextDatum(MC_DATUM); // 温度(上) tft.setTextColor(TFT_YELLOW); tft.drawString(String(temp,0) + "C", 120, 40, 4); // 天气(稍微下移) tft.drawString("Sunny", 120, 75, 2); // 福字(缩小一点) tft.setTextColor(TFT_RED); tft.drawString("Hello Alison", 120, 120, 4); // 湿度(下) tft.setTextColor(TFT_YELLOW); tft.drawString(String(hum) + "%", 120, 200, 4); }