1)Objective
In this project, we will use an Arduino Mega2560 board to drive ILI9341 or SSD1289 3.2″ touch screen.
2)Parts and Devices
Pictures | Device | Quantity |
![]() |
Arduino mega2560 board | 1 |
![]() |
3.2 inch ili9341 screen | 1 |
![]() |
3.2 inch screen adapter shield | 1 |
Put the screen(3.2 inch screen schematic) into shield (TFT01-3.2 shield schematic) first, then connect the shield to Arduino, it is quite straight forward.
3)Download and install UTFT ,URTouch ,SdFat,UTFT_Buttons and UTFT_SdRaw library file from following link and copy them into Arduino library folder. ( i.e. D:\arduino ide\Arduino 1.6.9\libraries )
UTFT :www.kookye.com/driver/UTFT.rar
URTouch:www.kookye.com/driver/URTouch.rar
SdFat:www.kookye.com/driver/SdFat.rar
UTFT_Buttons:www.kookye.com/driver/UTFT_Buttons.rar
UTFT_SdRaw :www.kookye.com/driver/UTFT_SdRaw.rar
4)Test
Download the test program (www.kookye.com/driver/3.2 inch touchscreen test.zip), upzip and open it,then choose the correct board and port.
在解压文件后会看到如图所示的文件结构
SD_test文件夹下面是SD测试sketch文件,其中附带了SD测试所需用到的测试图片;URTouch_ButtonTest_3.2文件夹下是在屏幕上显示一个触摸键盘程序;URTouch_Calibration_3.2文件夹里是液晶教程程序;URTouch_QuickDraw_3.2文件夹下是在屏幕上画线程序;URTouch_QuickPaint_3.2文件夹下是在屏上画不同颜色线程序;UTFT_Demo_320x240_Serial_3.2文件夹下的程序可以在屏幕上显示不同的图案,例如正弦函数、余弦函数图像等。
打开每个程序均能看到这样一句代码:UTFT myGLCD(CTE32_R2, 38, 39, 40, 41)如图所示
这句代码第一个参数是指定液晶控制器型号的,如果你的液晶控制器是ILI9341,第一个参数应该写成CTE32_R2或ILI9341_16;如果你的液晶显示器是SSD1289,那么第一个参数应该写成CTE32。如果你的液晶显示器不是这两种型号之一,为了能正确填写这个参数,可以查看UTFT库下的Documentation文件夹下说明文档或者直接打开UTFT库下水的UTFT.h文件查找你的液晶控制器对应的参数。液晶控制器型号可以查看触摸屏背部的丝印,如果是如图红框所示的丝印,说明这个触摸屏的液晶控制器是ILI9341.其他型号的液晶控制器可以通过同样的方法查看。
Note:在测试SD卡时候, Please insert the SD card into the slot in back of the 3.2’’ LCD screen. The format of files in SD card must be the FAT32, you need to put the test files(i.e. ICONS.RAW,WAIT4GPS.RAW,SK45) into the SD card root directory.
You can find the test files in 3.2 inch touchscreen test\SD_test\Image-files.
About the Author