CNAP
03 / Templates · intermediate

LCD 2004 FOUR ROWS

Open in Playground

Writes a static message to all four rows of a 20×4 LCD using the LiquidCrystal library in 4-bit mode. Identical wiring to the 1602 — only lcd.begin() changes.

intermediateLCDdisplayLiquidCrystaltext2004
Circuit
Code
sketch.inoArduino C++
15 lines
// LCD 2004 — fills all four rows
#include <LiquidCrystal.h>

// RS, E, D4, D5, D6, D7
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
  lcd.begin(20, 4);
  lcd.setCursor(0, 0); lcd.print("Row 0: Hello!");
  lcd.setCursor(0, 1); lcd.print("Row 1: Arduino");
  lcd.setCursor(0, 2); lcd.print("Row 2: LCD 2004");
  lcd.setCursor(0, 3); lcd.print("Row 3: 20 x 4");
}

void loop() {}
Components
  • wokwi-arduino-uno
    01
  • wokwi-lcd2004
    02
Wiring
Component PinArduino Pin
RSPin 12
RWGND
E (Enable)Pin 11
D4Pin 5
D5Pin 4
D6Pin 3
D7Pin 2
VSS, V0, RW, KGND
VDD, A (via 220 Ω)5V