The LCDI2C display 20x 4

I can't get more than 2 rows to display. And I should have 4 rows and 20 columns.

Welcome to the forum

Please post your full sketch, using code tags when you do

In my experience the easiest way to tidy up the code and add the code tags is as follows

Start by tidying up your code by using Tools/Auto Format in the IDE to make it easier to read. Then use Edit/Copy for Forum and paste what was copied in a new reply. Code tags will have been added to the code to make it easy to read in the forum thus making it easier to provide help.

It is also helpful to post error messages in code tags as it makes it easier to scroll through them and copy them for examination

1 Like

How are you doing it? The row addressing is non linear. You either must handle it yourself or use a library that handles the ugly details.

As suggested, please post your code and a diagram of your connections but your code is very important because less your code there is no way to give you an answer to your question. Also, and it will show in your code which library you are using.

A simple Google of I2C Display 20x4 code samples will bring up this sample code:

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

// Set the LCD address. Common addresses are 0x27 or 0x3F.
// You might need to run an I2C scanner sketch to find the correct address for your module.
LiquidCrystal_I2C lcd(0x27, 20, 4);  // I2C address, 20 columns, 4 rows

void setup() {
  // Initialize the LCD
  lcd.init();
  // Turn on the backlight
  lcd.backlight();

  // Set the cursor to the first column (0) and first row (0)
  lcd.setCursor(0, 0);
  // Print a message to the first row
  lcd.print("Hello, world!");

  // Set the cursor to the first column (0) and second row (1)
  lcd.setCursor(0, 1);
  // Print a message to the second row
  lcd.print("Arduino I2C LCD");

  // Set the cursor to the first column (0) and third row (2)
  lcd.setCursor(0, 2);
  // Print a message to the third row
  lcd.print("20x4 Display");

  // Set the cursor to the first column (0) and fourth row (3)
  lcd.setCursor(0, 3);
  // Print a message to the fourth row
  lcd.print("Example Code");
}

void loop() {
  // The loop can be used for dynamic content updates, scrolling text, etc.
  // For this basic example, it remains empty.
}

This should work and you may have to add the library to your code as seen above.

TNX

Ron