This repository has been archived on 2021-10-13. You can view files and clone it, but cannot push or open issues or pull requests.
ESP32_I2C_16x2_LCD/I2C_LCD.ino

30 lines
929 B
Arduino
Raw Permalink Normal View History

2021-03-23 10:23:48 +00:00
// Include the Wire.h library. This is the I2C library
#include <Wire.h>
// Include the LiquidCrystal_I2C library. This is the library allowing us to communicate with the screen using I2C
#include <LiquidCrystal_I2C.h>
// Create a new variable of the LCD type and insert the appropriate values
// The type takes the following values:
// 1. The I2C address of the LCD (0x20 to 0x27)
// 2. The amount of character columns
// 3. The amount of character rows
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup(){
// Initialize the connection to the display
lcd.init();
// Turn the display backlight on
lcd.backlight();
// Set the cursor to the first character on the first row
lcd.setCursor(0,0);
// Print "Hello," to the display
lcd.print("Hello,");
// Set the cursor to the first character on the second row
lcd.setCursor(0,1);
// Print "World!" to the display
lcd.print("World!");
}
void loop(){
}