1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#include <Arduino.h>
#include <TFT_eSPI.h>
#include <SPI.h>
#include "GfxUi.h"
#include <SPIFFS.h>
TFT_eSPI tft = TFT_eSPI(135, 240);
GfxUi ui = GfxUi(&tft);
void setup()
{
Serial.begin(115200);
tft.init();
tft.setRotation(3);
SPIFFS.begin(true);//FORMAT_SPIFFS_IF_FAILED
ui.drawBmp("/esp_home.bmp", 0, 0);//'ui' needs tft and SPIFF
tft.setCursor(0, 0);
tft.setTextColor(TFT_GREEN);
tft.setTextSize(2);
tft.drawString("Hello TFT World", tft.width() / 2, tft.height() / 2 );
}
void loop()
{
}
|