Initial commit

This commit is contained in:
Sebastian Hernø Gabrielli (Elev) 2021-03-23 11:23:48 +01:00
commit b4610b5f8f
2 changed files with 30 additions and 0 deletions

29
I2C_LCD.ino Normal file
View File

@ -0,0 +1,29 @@
// 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(){
}

1
README.md Normal file
View File

@ -0,0 +1 @@
#ESP32 I2C communication with 16x2 LCD example code