Mega2560板+3.2寸屏+扩展板使用说明教程

Byamber

Mega2560板+3.2寸屏+扩展板使用说明教程


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
7 Arduino mega2560 board 1
3.2inchscreen for mega2560 3.2 inch ili9341 screen 1
3,2inchscreenadaptershield 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.

3.2inchscreen-4-2

3.2inchscreen-4-3

在解压文件后会看到如图所示的文件结构

3.2inchscreen-4-1

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)如图所示

3.2inchscreen-4-4

这句代码第一个参数是指定液晶控制器型号的,如果你的液晶控制器是ILI9341,第一个参数应该写成CTE32_R2或ILI9341_16;如果你的液晶显示器是SSD1289,那么第一个参数应该写成CTE32。如果你的液晶显示器不是这两种型号之一,为了能正确填写这个参数,可以查看UTFT库下的Documentation文件夹下说明文档或者直接打开UTFT库下水的UTFT.h文件查找你的液晶控制器对应的参数。液晶控制器型号可以查看触摸屏背部的丝印,如果是如图红框所示的丝印,说明这个触摸屏的液晶控制器是ILI9341.其他型号的液晶控制器可以通过同样的方法查看。
TFT LCD touch screen

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.

3.2inchscreen-4-5

You can find the test files in 3.2 inch touchscreen test\SD_test\Image-files.

About the Author

amber administrator

4 Comments so far

IndypetePosted on  8:41 am - Jul 1, 2017

Please fix the dead links. Very hard to get this working without them.

michael78Posted on  8:54 pm - Aug 9, 2017

Hi, I cant install the URTouch:zip. Getting the flowing error
LIBRARIES THAT COULD NOT BE IMPORTED:
[] [cCb9rsSA] 400 invalid_request: attribute “name” of response is missing and required, attribute: name, parent: response.

Same error displayed when uploading UTFT_Buttons:
[] [/FlV+W2Q] 400 invalid_request: attribute “name” of response is missing and required, attribute: name, parent: response

DonaldBoltPosted on  10:08 am - Nov 22, 2017

I have followed all of the instructions for the 9341 touch screen with mega and shield. All I get is a white screen. Please advise what is wrong. This is my controller code I am using. UTFT myGLCD(CTE32_R2, 38, 39, 40, 41); I also tried the ILI9341_16 controller, and it is also just a white screen.

Comments are closed.

Comments Are Closed!!!