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
Sebastian Hernø Gabrielli (Elev) b4610b5f8f Initial commit
2021-03-23 11:23:48 +01:00

30 lines
929 B
C++

// 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(){
}