2.2-inch ILI9225 Color Screen
Module Source
Purchase Link: https://item.taobao.com/item.htm?spm=a21n57.1.0.0.5cb3523chlpcq5&id=38360709299&ns=1&abbucket=0
Baidu Netdisk Download Link: http://pan.baidu.com/s/1ntDixJz
Specifications
Operating Voltage:3.3V
Operating Current:20MA
Module Dimensions:67.20(H) x 42.46(W)
Pixel Resolution:176(H) x 220(V)RGB
Driver Chip:ILI9225
Communication protocol:SPI
Pin Count:8 Pin (2.54mm pitch header)
Hardware Connection
Here is the basic wiring for the ILI9225 TFT screen with the development board:
- VCC: Connect to the Arduino's 5V (or according to your screen's specifications, some may require 3.3V).
- GND: Connect to the Arduino's GND.
- CS (or TFT_CS): Chip select, connect to a digital pin on the Arduino, such as pin 10.
- RESET (or TFT_RST): Reset, connect to a digital pin on the Arduino, such as pin 9.
- RS/DC (or TFT_RS): Command/data control, connect to a digital pin on the Arduino, such as pin 8.
- SDI/MOSI (or TFT_MOSI): Master out, slave in, connect to the Arduino's pin 11 (for UNO).
- SCK (or TFT_SCK): Clock, connect to the Arduino's pin 13 (for UNO).
- LED: Backlight control, can be connected directly to the Arduino's 3.3V or 5V, with a resistor for current limiting, or connected to a PWM output to control brightness.
- SDO/MISO (or TFT_MISO): Master in, slave out; if you need to read data from the TFT, this line needs to be connected to the Arduino's pin 12 (for UNO).
Usage Method
Installing Library Files (skip this step if already installed)
- Open the Arduino IDE.
- Go to “Tools” > “Manage Libraries…”.
- Install the TFT_22_ILI9225 library via “Manage Libraries” (search for TFT_22_ILI9225 in Tools > Libraries > Manage Libraries... and install it).
Enter the code:
c
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: March 28, 2024
* Function Overview:
*****************************************************************************
* Open-source development board hardware and software information and related projects hardware and software information on official website
* Development board official website: www.lckfb.com
* Technical support resident forum, any technical problems are welcome at any time to exchange learning
* LCSC Forum: club.szlcsc.com
* Follow our Bilibili account: [立创开发板], stay toned to our latest news!
* We focus on cultivating Chinese engineers rather than profiting from board sales.
******************************************************************************/
#include <TFT_22_ILI9225.h>
// 定义连接引脚
#define TFT_RST 9
#define TFT_RS 8
#define TFT_CS 10 // SS
#define TFT_SDI 11 // MOSI
#define TFT_CLK 13 // SCK
#define TFT_LED 0 // 不接或者接5v,这里写0是为了兼容库
// 创建TFT对象
TFT_22_ILI9225 tft = TFT_22_ILI9225(TFT_RST, TFT_RS, TFT_CS, TFT_SDI, TFT_CLK, TFT_LED);
void setup() {
tft.begin();
tft.setOrientation(2);
tft.setBackgroundColor(COLOR_BLACK);
tft.setFont(Terminal12x16);// Terminal11x16 Terminal12x16 Trebuchet_MS16x21
tft.drawText(10, 10, "Hello, World!", COLOR_WHITE);
}
void loop() {
// 这里不做重复绘制,仅初始化显示
}
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
40
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
40