-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_display.cpp
More file actions
39 lines (29 loc) · 802 Bytes
/
test_display.cpp
File metadata and controls
39 lines (29 loc) · 802 Bytes
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
30
31
32
33
34
35
36
37
38
39
// Simple TFT test to verify display is working
// Temporarily rename main.cpp and rename this to main.cpp to test
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
void setup() {
Serial.begin(115200);
Serial.println("TFT Test Starting...");
tft.init();
tft.setRotation(0);
Serial.println("Filling screen red...");
tft.fillScreen(TFT_RED);
delay(1000);
Serial.println("Filling screen green...");
tft.fillScreen(TFT_GREEN);
delay(1000);
Serial.println("Filling screen blue...");
tft.fillScreen(TFT_BLUE);
delay(1000);
Serial.println("Drawing white text...");
tft.fillScreen(TFT_BLACK);
tft.setTextColor(TFT_WHITE);
tft.setTextSize(2);
tft.setCursor(10, 10);
tft.println("Display Works!");
Serial.println("Test complete!");
}
void loop() {
// Nothing
}