HOW to Show Characters on LCD Display with ESP32
Description
This is a 128*32 pixel LCD module, which uses IIC communication mode and ST7567A driver chip . At the same time, the code contains all the English letters and common symbols of the library that can be directly called. When used, we can also set English letters and symbols to display different text sizes in our code.
To make it easy to set up the pattern display, we also provide a mold capture software that can convert a specific pattern into control code and then copy it directly into the test code for use.
In the experiment, we will set up the display screen to display various English words, common symbols and numbers.
Working Principle
The module uses the IIC communication principle, the underlying functions have been encapsulated in the library surface, we can directly call the library function, if interested, you can also go to understand the underlying driver of the module.
Components
|
|
|
|
|
---|---|---|---|---|
ESP32 Board*1 |
ESP32 Expansion Board*1 |
Keyestudio LCD_128X32_DOT Module*1 |
4P Dupont Wire*1 |
Micro USB Cable*1 |
Connection Diagram
Test Code
//**********************************************************************************
/*
* Description : Lcd128 *32 Displays character strings
* Auther : http//www.keyestudio.com
*/
#include "lcd128_32_io.h"
//Create lcd12832 examples,sda--->21, scl--->22
lcd lcd(21, 22);
void setup() {
lcd.Init(); //initialize
lcd.Clear(); //cls
}
void loop() {
lcd.Cursor(0, 7); //Set display position
lcd.Display("KEYES"); //Setting the display
lcd.Cursor(1, 0);
lcd.Display("ABCDEFGHIJKLMNOPQR");
lcd.Cursor(2, 0);
lcd.Display("123456789+-*/<>=$@");
lcd.Cursor(3, 0);
lcd.Display("%^&(){}:;'|?,.~\\[]");
}
//**********************************************************************************
Code Explanation
First import the library file 1.Init() initializes the display screen; .Clear() clears the display; .Cursor() sets the display position; .Display() displays characters.
Test Result
Connect the wires according to the experimental wiring diagram, compile and upload the code to the ESP32. After uploading successfully,we will use a USB cable to power on. The first line of the 128X32LCD module display shows “KEYES”, the second line shows “ABCDEFGHIJKLMNOPQR”, and the third line shows “123456789±*/<> =$@”, the fourth line displays “%^&(){}:;’|?,.~\[]”