Arduino lcd I2C

I bought an I2C lcd display but I can't get it to work. I added the library LiquideCrystal_I2C and I connected the cables but when I lift my code nothing happens. My screen is on and the first line is filled with rectangles. Here is the code I try:

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

LiquidCrystal_I2C lcd(0x27,16,2);

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

lcd.setCursor(1,0);
lcd.print("Hello World");

}

void loop() {

}

I hope you can help me

Antoine Pirot

Welcome to the forum

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

Have you tried adjusting the contrast pot?

After that, try running the i²c scanner sketch to confirm that 0x27 is the correct address for your display.

You wrote Hello world in Setup which will only show once startup

The things you want to loop or repeat kindly add them in void loop

this is a proof that LCD working. check A4/A5 swaping, check initial addres

problem is not the code..
looks just like the sim below..
UnoI2cLCD

bad connection maybe..

~q

thank you for all your answers but the problem was the address. It was not 0x27 but 0x3F in my case.
Thank you very much for your help.

1 Like

Did you determine this by running the I2C Scanner?
For whatever reason that never works for me.

yes I found in this video.

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