1.69-Inch Color Screen
Module Source
Purchase Link:
https://item.taobao.com/item.htm?id=636002776097&_u=n1q56pn3e33f
Baidu Netdisk Download Link:
https://pan.baidu.com/s/1Q4s3fk0uy8AP5aqNZ3fBmg
Password: 8888
Specifications
Operating Voltage: 3.3V
Operating Current:90MA
Module Dimensions:31(H) x 48(V) MM
Pixel Resolution:240(H) x 280(V)RGB
Driver Chip:ST7789V2
Communication Protocol:SPI
Pin Count: 8 Pin (2.54mm pitch header)
Hardware Connection
The TFT color display typically connects to the development board via SPI communication. The basic SPI wiring is as follows (actual pins may need adjustment based on your display’s datasheet):
- TFT VCC -> Development board 5V
- TFT GND -> Development board GND
- TFT SCL -> Development board SCK (Pin 13)
- TFT SDA -> Development board MOSI (Pin 11)
- TFT RES -> Development board Digital Pin 9
- TFT DC -> Development board Digital Pin 8
- TFT CS -> Development board Digital Pin 10
- TFT BLK -> Arduino 3.3V
Usage Method
Installing Library Files (skip this step if already installed)
- Open the Arduino IDE.
- Go to “Tools” > “Manage Libraries…”.
- Search for “Adafruit ST7789” and “Adafruit GFX”, and install each library individually.
Enter the code:
For the 1.69-inch ST7789V3 screen with a resolution of 240x280 pixels, you need to adjust the screen initialization part of the code. Here’s a revised example:
/******************************************************************************
* Test Hardware: LCSC ColorEasyDuino Development Board
* Version Number: V1.0
* Modified By: www.lckfb.com
* Modification Date: March 26, 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 <Adafruit_GFX.h> // Include Adafruit GFX library
#include <Adafruit_ST7789.h> // Include Adafruit ST7789 library
#define TFT_CS 10
#define TFT_RST 9 // Set to -1 if not using reset pin
#define TFT_DC 8
// Note: The width and height of the screen may need to be adjusted.
Adafruit_ST7789 tft = Adafruit_ST7789(TFT_CS, TFT_DC, TFT_RST);
char i =48;
void setup() {
tft.init(240, 280); // Initialize the screen and set the resolution to 240x280
tft.setRotation(2); // Set rotation
tft.fillScreen(ST77XX_BLACK); // Clear screen to black
tft.setTextSize(2); // Set text size
tft.setTextColor(ST77XX_WHITE); // Set text color
tft.setCursor(5, 100); // Set text display coordinates
tft.print("Hello, World"); // Set displayed text
}
void loop() {
tft.setCursor(50, 50); // Set the display coordinates
tft.fillRect(50,50,16,16,ST77XX_BLACK); //Fill a specific area with black
tft.print(i); //Display content
i++; //Update content
delay(1000);
}
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
41
42
43