How to Use I2C LCD_128X32_DOT with Arduino?
1.Introduction
We can use modules such as monitors to do various experiments in life. You can also DIY a variety of small objects. For example, you can make a temperature meter with a temperature sensor and display, or make a distance meter with an ultrasonic module and display.
In this project, we will use the LCD_128X32_DOT module as a display and connect it to the Plus control board. The Plus mainboard will be used to control the LCD_128X32_DOT display to show various English characters, common symbols and numbers.
2.Components Required
|
|
|
|
---|---|---|---|
Keyestudio Plus Mainboard*1 |
LCD_128X32_DOT*1 |
F-F Dupont Wires |
USB Cable*1 |
3.Component Knowledge
LCD_128X32_DOT: It is an LCD module with 128*32 pixels and its driver chip is ST7567A. The module uses the IIC communication mode, while the code contains a library of all alphabets and common symbols that can be called directly. When using, we can also set it in the code so that the English letters and symbols show different text sizes.
Schematic diagram:
Features:
Pixel:128*32 character
Operating voltage(chip):4.5V to 5.5V
Operating current:100mA (5.0V)
Optimal operating voltage(module):5.0V
4.Connection Diagram
5.Code
Note: The library file is required in the code. If you have already added the “lcd” library file, you can ignore the process of adding library files.
Put the decompressed “LCD_128X32” folder into “Arduino libraries” under the compiler installation directory.
After successful placement, you need to restart the compiler, otherwise the compilation will not work.
e.g :C:\Program Files\Arduino\libraries
/*
I2C LCD_128X32_DOT
http//www.keyestudio.com
*/
#include //add library files
lcd Lcd; //define a Lcd class instance
void setup() {
Lcd.Init(); //initialize
Lcd.Clear(); //clear
}
void loop() {
Lcd.Cursor(0, 4); //Set the first row and the eighth column to display, same as below
Lcd.Display("KEYESTUDIO"); //Display KEYESTUDIO, same as below
Lcd.Cursor(1, 0);
Lcd.Display("ABCDEFGHIJKLMNOPQR");
Lcd.Cursor(2, 0);
Lcd.Display("123456789+-*/<>=$@");
Lcd.Cursor(3, 0);
Lcd.Display("%^&(){}:;'|?,.~\\[]");
}
6.Result
Upload the project code, wire up and power on, the LCD module display will show “KEYESTUDIO” at the first line.
“ABCDEFGHIJKLMNOPQR” will be displayed at the second line.
“123456789 + - * / <> = $ @ ” will shown at the third line and “% ^ & () {} :; ‘|?,. ~ [] ” will be displayed at the fourth line.