BytesOfProgress

Wiki


ESP32 I2C LCD Display (16x2 / 20x4)

Generally, the coordinate you want to speak to, in its code form, is always n-1. That means if you want to display something on the 3rd cell of the second row, you use cell 2 of row 1 in the code.

This example uses a 20x4 display.


  // Libraries
  #include <Wire.h>
  #include <LiquidCrystal_I2C.h>

  // Display data
  LiquidCrystal_I2C lcd(0x27,20,4);

  void setup() {
    lcd.init();
    lcd.backlight();
    lcd.clear();
  }

  void loop() {
    lcd.setCursor(4, 1);
    lcd.print("Hello World!");
  }




back