Template: 2inch-LCD-Module-STM32-Guides
From Waveshare Wiki
Hardware Connection
The examples are based on STM32F103RBT6 as well as the connection table. If you want to use other MCU, you need to port the project and change the connection according to the actual hardware.
LCD | STM32 |
VCC | 3.3V |
GND | GND |
DIN | PA7 |
CLK | PA5 |
CS | PB6 |
DC | PA8 |
RST | PA9 |
BL | PC7 |
Use Waveshare XNUCLEO-F103RB as examples
About the examples
The examples use HAL libraries.
Download demo codes, unzip, and find the STM32 projects. Open LCD_demo.uvprojx which is located in STM32\STM32F103RBT6\MDK-ARM directory by Keil project
Open main.c file, you can configure the types for actual displays, recompile the project and download it to your board.
LCD_0in96_test() | 0.96inch LCD example |
LCD_1in14_test() | 1.14inch LCD example |
LCD_1in28_test() | 1.28inch LCD example |
LCD_1in3_test() | 1.3inch LCD example |
LCD_1in54_test() | 1.54inch LCD example |
LCD_1in8_test() | 1.8inch LCD example |
LCD_2in_test() | 2inchLCDexample |
Arduino
- Download examples from wiki. Unzip it. The path of Arduino examples is ~/Arduino UNO/...
- Copyt the folders in Arduino directory to 【Installation directory】/libraries/ (Generally the installation directory is C:\Program Files (x86)\Arduino\libraries)
- Open Arduino IDE software, and click File -> Examples to check if LCD_2inch codes are there.
- The development board used is Arduino UNO.
Hardware connection
2inch LCD | UNO PLUS |
VCC | 5V |
GND | GND |
DIN | D11 |
CLK | D12 |
CS | D10 |
DC | D7 |
RST | D8 |
BL | D9 |
Expected result
- The display is cleaned to white
- Display numbers and strings
- Draw a rectangle
- Draw a line
- Draw five circles
- Display a 70x70 image