In this tutorial we will see how to display a text in an LCD display with the ESP32 card:
Connecting wires
To carry out the assembly, you must connect:
the SDA pin of the LCD display to pin D21 of the ESP32 board
the SCL pin of the LCD display to pin D22 of the ESP32 board
the GND pin of the LCD display to the GND pin of the ESP32 board
the VCC pin of the LCD display to 5V-9V energy
Here is the program that allows you to display a text on the LCD display.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
#include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x27, 20, 4); void setup() { lcd.init(); } void loop() { lcd.backlight(); lcd.setCursor(0, 0); lcd.print(" Carte"); lcd.setCursor(0,1); lcd.print(" ESP32"); } |
Note: you need to download the library LiquidCrystal_I2C (Download).