Hello! I’m having trouble initializing a 3.2" TFT display using an Arduino Due and the UTFT library. I’m not sure whether this is a problem with the wiring, as the pinout diagram is in a different language, or if the example code i’m using needs to be edited. I’m relatively new to arduino, so bare with me.
Here is the wiring:
TFT–DUE
gnd(1)–gnd
vcc(2)–5V
nc(3)–unused
RS(4)–Ana 1
WR(5)–Ana 2
(6)to (14)–unused
CS(15)–Ana 0
(16)–unused
REST(17)–Reset
DB0(21)–Digital 0
DB1(22)–Digital 1
DB2(23)–Digital 2
DB3(24)–Digital 3
DB4(25)–Digital 4
DB5(26)–Digital 5
DB6(27)–Digital 6
DB7(28)–Digital 7
(29) to (34)–unused
SD_DO(35)–Digital 12
SD_CLK(36)–Digital 13
SD_DIN(37)–Digital 11
(38) to (40)–unused
And the code:
#include <UTFT.h>
UTFT myGLCD(ITDB32S,19,18,17,16);
// Declare which fonts we will be using
extern uint8_t BigFont[];
extern uint8_t SevenSegNumFont[];
void setup()
{
myGLCD.InitLCD();
myGLCD.clrScr();
myGLCD.setFont(BigFont);
}
void loop()
{
myGLCD.print("Text rotation", 0, 0);
myGLCD.setColor(0, 0, 255);
myGLCD.print("0 degrees", 0, 16, 0);
myGLCD.print("90 degrees", 319, 0, 90);
myGLCD.print("180 degrees", 319, 239, 180);
myGLCD.print("270 degrees", 0, 239, 270);
myGLCD.setFont(SevenSegNumFont);
myGLCD.setColor(0, 255, 0);
myGLCD.print("45", 90, 100, 45);
myGLCD.print("90", 200, 50, 90);
myGLCD.print("180", 300, 200, 180);
while (true) {};
}
**Please note i had to change the DefaultFonts.c file to “const fontdatatype SevenSegNumFont[2004] PROGMEM={” , as i was getting an error before i added “const”.
If you need any more information, feel free to ask. Any help would be greatly appreciated. Thanks!