SunFounder ESP32 Starter Kit
When this program is uploaded, the I2C LCD1602 will display the welcome message, “Hello, Sunfounder!”, for 3
seconds. After that, the screen will show a “COUNT:” label and the count value, which increments every second.
Note: If the code and wiring are correct, but the LCD still fails to display any content, you can adjust the potentiometer
on the back to increase the contrast.
How it works?
By calling the library LiquidCrystal_I2C.h, you can easily drive the LCD.
#include <LiquidCrystal_I2C.h>
Library Functions
• Creates a new instance of the LiquidCrystal_I2C class that represents a particular LCD attached to your
Arduino board.
LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows)
– lcd_AddR: The address of the LCD defaults to 0x27.
– lcd_cols: The LCD1602 has 16 columns.
– lcd_rows: The LCD1602 has 2 rows.
• Initialize the lcd.
void init()
• Turn the (optional) backlight on.
void backlight()
• Turn the (optional) backlight off.
40 Chapter 1. For Arduino User