From b4610b5f8fd79785bbb45e0c5a98249570de8a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Hern=C3=B8=20Gabrielli=20=28Elev=29?= Date: Tue, 23 Mar 2021 11:23:48 +0100 Subject: [PATCH] Initial commit --- I2C_LCD.ino | 29 +++++++++++++++++++++++++++++ README.md | 1 + 2 files changed, 30 insertions(+) create mode 100644 I2C_LCD.ino create mode 100644 README.md diff --git a/I2C_LCD.ino b/I2C_LCD.ino new file mode 100644 index 0000000..e0829f3 --- /dev/null +++ b/I2C_LCD.ino @@ -0,0 +1,29 @@ +// Include the Wire.h library. This is the I2C library +#include +// Include the LiquidCrystal_I2C library. This is the library allowing us to communicate with the screen using I2C +#include + +// 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(){ +} diff --git a/README.md b/README.md new file mode 100644 index 0000000..d45e4ac --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +#ESP32 I2C communication with 16x2 LCD example code