Arduino Playground

LCD-1602 Arduino Simulation

The LCD1602 is connected at I²C address 0x27.

Click the "Run Code" button on the right to see it in action:

Can you change the code to print your name?


Have questions? Feedback? Please share with us below:

sketch.ino

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 16, 2);

byte heart[8] = {
  0b00000,
  0b01010,
  0b11111,
  0b11111,
  0b11111,
  0b01110,
  0b00100,
  0b00000,
};

void setup() {
  lcd.init();
  lcd.backlight();
  lcd.createChar(3, heart);
  lcd.setCursor(2, 0);
  lcd.print("I \x03 Arduino \xaf");
  lcd.blink();
}

int i = 0;
char *msg = "Hello, World!";
void loop() {
  if (i < strlen(msg)) {
    lcd.setCursor(i + 2, 1);
    lcd.print(msg[i]);
    i++;
  }
  delay(200);
}