Hello, I bought a 3.5" ST9976U TFT LCD display. I'm trying to get the display working and so far no luck. I'm trying to use the TFT_eSPI library. And so far no luck. I even define the pins for the display and the same thing comes up.
This is my display: here.
This is my code:
#include <TFT_eSPI.h>
TFT_eSPI tft = TFT_eSPI();
#define TFT_MOSI 11
#define TFT_MISO 12
#define TFT_SCLK 13
#define TFT_CS 10
#define TFT_RS 9 // RS pin
#define TFT_RST 8
#define ST7796_DRIVER
void setup() {
tft.init();
tft.setRotation(1);
tft.fillScreen(TFT_BLACK);
tft.setCursor(20, 40);
tft.setTextColor(TFT_YELLOW, TFT_BLACK);
tft.setTextSize(3);
tft.println("ST7796U SPI + RS");
tft.drawTriangle(50,200,150,200,100,100,TFT_RED);
}
void loop() {}
This is the output:
In file included from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:973:8: warning: #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available! [-Wcpp]
973 | #warning >>>>------>> TOUCH_CS pin not defined, TFT_eSPI touch functions will not be available!
| ^~~~~~~
C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:4: warning: "TFT_MOSI" redefined
4 | #define TFT_MOSI 11
|
In file included from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup_Select.h:27,
from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:69,
from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup.h:171: note: this is the location of the previous definition
171 | #define TFT_MOSI PIN_D7 // Automatically assigned with ESP8266 if not defined
|
C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:5: warning: "TFT_MISO" redefined
5 | #define TFT_MISO 12
|
In file included from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup_Select.h:27,
from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:69,
from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup.h:170: note: this is the location of the previous definition
170 | #define TFT_MISO PIN_D6 // Automatically assigned with ESP8266 if not defined
|
C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:6: warning: "TFT_SCLK" redefined
6 | #define TFT_SCLK 13
|
In file included from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup_Select.h:27,
from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:69,
from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup.h:172: note: this is the location of the previous definition
172 | #define TFT_SCLK PIN_D5 // Automatically assigned with ESP8266 if not defined
|
C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:7: warning: "TFT_CS" redefined
7 | #define TFT_CS 10
|
In file included from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup_Select.h:27,
from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:69,
from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup.h:174: note: this is the location of the previous definition
174 | #define TFT_CS PIN_D8 // Chip select control pin D8
|
C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:9: warning: "TFT_RST" redefined
9 | #define TFT_RST 8
|
In file included from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup_Select.h:27,
from c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/TFT_eSPI.h:69,
from C:\Users\Jester\AppData\Local\Temp\.arduinoIDE-unsaved20251021-23216-1u5fbu3.7xmd\sketch_nov21d\sketch_nov21d.ino:1:
c:\Users\Jester\Documents\Arduino\libraries\TFT_eSPI/User_Setup.h:176: note: this is the location of the previous definition
176 | #define TFT_RST PIN_D4 // Reset pin (could connect to NodeMCU RST, see next line)
|
Sketch uses 51048 bytes (10%) of program storage space. Maximum is 507904 bytes.
Device : ATSAMD51x19
Version : v1.1 [Arduino:XYZ] Apr 8 2018 16:27:40
Address : 0x0
Pages : 1024
Page Size : 512 bytes
Total Size : 512KB
Planes : 1
Lock Regions : 32
Locked : none
Security : false
BOD : false
BOR : true
Write 52704 bytes to flash (103 pages)
[ ] 0% (0/103 pages)
[== ] 7% (8/103 pages)
[==== ] 15% (16/103 pages)
[====== ] 23% (24/103 pages)
[========= ] 31% (32/103 pages)
[=========== ] 38% (40/103 pages)
[============= ] 46% (48/103 pages)
[================ ] 54% (56/103 pages)
[================== ] 62% (64/103 pages)
[==================== ] 69% (72/103 pages)
[======================= ] 77% (80/103 pages)
[========================= ] 85% (88/103 pages)
[=========================== ] 93% (96/103 pages)
[==============================] 100% (103/103 pages)
Done in 0.923 seconds
Verify 52704 bytes of flash
[= ] 3% (4/103 pages)
[= ] 4% (5/103 pages)
[= ] 5% (6/103 pages)
[== ] 6% (7/103 pages)
[== ] 7% (8/103 pages)
[== ] 8% (9/103 pages)
[== ] 9% (10/103 pages)
[=== ] 10% (11/103 pages)
[=== ] 11% (12/103 pages)
[=== ] 12% (13/103 pages)
[==== ] 13% (14/103 pages)
[==== ] 14% (15/103 pages)
[==== ] 15% (16/103 pages)
[==== ] 16% (17/103 pages)
[===== ] 17% (18/103 pages)
[===== ] 18% (19/103 pages)
[===== ] 19% (20/103 pages)
[====== ] 20% (21/103 pages)
[====== ] 21% (22/103 pages)
[====== ] 22% (23/103 pages)
[====== ] 23% (24/103 pages)
[======= ] 24% (25/103 pages)
[======= ] 25% (26/103 pages)
[======= ] 26% (27/103 pages)
[======== ] 27% (28/103 pages)
[======== ] 28% (29/103 pages)
[======== ] 29% (30/103 pages)
[========= ] 30% (31/103 pages)
[========= ] 31% (32/103 pages)
[========= ] 32% (33/103 pages)
[========= ] 33% (34/103 pages)
[========== ] 33% (35/103 pages)
[========== ] 34% (36/103 pages)
[========== ] 35% (37/103 pages)
[=========== ] 36% (38/103 pages)
[=========== ] 37% (39/103 pages)
[=========== ] 38% (40/103 pages)
[=========== ] 39% (41/103 pages)
[============ ] 40% (42/103 pages)
[============ ] 41% (43/103 pages)
[============ ] 42% (44/103 pages)
[============= ] 43% (45/103 pages)
[============= ] 44% (46/103 pages)
[============= ] 45% (47/103 pages)
[============= ] 46% (48/103 pages)
[============== ] 47% (49/103 pages)
[============== ] 48% (50/103 pages)
[============== ] 49% (51/103 pages)
[=============== ] 50% (52/103 pages)
[=============== ] 51% (53/103 pages)
[=============== ] 52% (54/103 pages)
[================ ] 53% (55/103 pages)
[================ ] 54% (56/103 pages)
[================ ] 55% (57/103 pages)
[================ ] 56% (58/103 pages)
[================= ] 57% (59/103 pages)
[================= ] 58% (60/103 pages)
[================= ] 59% (61/103 pages)
[================== ] 60% (62/103 pages)
[================== ] 61% (63/103 pages)
[================== ] 62% (64/103 pages)
[================== ] 63% (65/103 pages)
[=================== ] 64% (66/103 pages)
[=================== ] 65% (67/103 pages)
[=================== ] 66% (68/103 pages)
[==================== ] 66% (69/103 pages)
[==================== ] 67% (70/103 pages)
[==================== ] 68% (71/103 pages)
[==================== ] 69% (72/103 pages)
[===================== ] 70% (73/103 pages)
[===================== ] 71% (74/103 pages)
[===================== ] 72% (75/103 pages)
[====================== ] 73% (76/103 pages)
[====================== ] 74% (77/103 pages)
[====================== ] 75% (78/103 pages)
[======================= ] 76% (79/103 pages)
[======================= ] 77% (80/103 pages)
[======================= ] 78% (81/103 pages)
[======================= ] 79% (82/103 pages)
[======================== ] 80% (83/103 pages)
[======================== ] 81% (84/103 pages)
[======================== ] 82% (85/103 pages)
[========================= ] 83% (86/103 pages)
[========================= ] 84% (87/103 pages)
[========================= ] 85% (88/103 pages)
[========================= ] 86% (89/103 pages)
[========================== ] 87% (90/103 pages)
[========================== ] 88% (91/103 pages)
[========================== ] 89% (92/103 pages)
[=========================== ] 90% (93/103 pages)
[=========================== ] 91% (94/103 pages)
[=========================== ] 92% (95/103 pages)
[=========================== ] 93% (96/103 pages)
[============================ ] 94% (97/103 pages)
[============================ ] 95% (98/103 pages)
[============================ ] 96% (99/103 pages)
[============================= ] 97% (100/103 pages)
[============================= ] 98% (101/103 pages)
[============================= ] 99% (102/103 pages)
[==============================] 100% (103/103 pages)
Verify successful
Done in 0.386 seconds
I thought the Display was bad and I upload a different different library for a small display with a different driver on it and the Display lights up with a bunch of pixels. So i know the display is working. I just don't know what I'm doing wrong or is this the wrong library, missing code. Not sure what to do next. I need help please?
Joseph