LCD I2C White square displayed

Hi, I am using a 2IC LCD 2*16 and I have the following issue:

While playing the « Hello World » prgm only white squares are displayed on the first line.

I use a Mega so SDA and SLC are on pin 20 and 21.

I played the « scanner » prgm to check the I2C address to use which also helped me to confirm that my connection to pins are good (whenever I unplug one pin or if I exchange the 2 pins 20 and 21 then I2C device is not recognised anymore)

But still I have those white squares…
If anyone has an idea I would be very greatfull.

Here is my hello world code.

#include "Wire.h"
#include "LiquidCrystal_I2C.h"

LiquidCrystal_I2C LCD(0*27,16,2);

void setup(){
  Serial.begin(9600);
  LCD.init();
  LCD.backlight();
}

void loop(){
LCD.setCursor(0,0);
LCD.print("HELLO");
Serial.println("HELLO");
LCD.setCursor(0,1);
LCD.print("WORLD");

}

And here is what I see on LCD screen:

Try adjusting contrast with the potentiometer in the backpack of the LCD.

If nothing change try with

LiquidCrystal_I2C LCD(0*3F,16,2);

instead of

LiquidCrystal_I2C LCD(0*27,16,2);

Thanks Maximo,

However I have no potentiometer on my LCD… but I don’t think this is the reason neither regarding the I2C adress (027 is good)

Indeed reading from another similar subject I’ve installed hd44780 library and I’ve run the I2CexpDiag squetch.

Strangely while doing this I got my LCD to display runtime properly.

I say strangely because then I tried to run the « hello world » squetch which comes with the library and then got the same pb again: white square on the first line. :cry:

So I know my LCD can work, but I don’t know how to do it :sweat_smile:

Anyone with any suggestion?

Problem solved!
I was not using the correct « hello world » program. Now everything is displaying properly!

what does that mean? can you post the correct program now?

btw

LiquidCrystal_I2C LCD(0*27,16,2);

if you multiply 0 with 27 you will get 0. So this can't be correct.
If your I2C scanner reports 0x27 you should use 0x27 and not 0*27

1 Like

Each i/o class in the hd44780 library has its own examples and its own HelloWorld sketch. Likely the OP was running a HelloWorld from the wrong i/o class for his LCD.

--- bill

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.