16x2 LCD display only has boxes on the top row

I'm pretty new to this so I have no clue what I did wrong.
My LCD is only showing boxes on the top row when I turn on the Arduino.
I've searched the internet a bit but couldn't find anything that helped.
The code I'm currently using is below as well as a picture of the LCD.
Also, sorry if I'm doing this wrong. :slight_smile:

#include <LiquidCrystal.h>
LiquidCrystal lcd = LiquidCrystal(7, 6, 5, 4, 3, 2); // (RS, EN, D4, D5, D6, D7)

void setup()
{
   lcd.begin(16, 2);
   lcd.clear();
   lcd.print("Hello World!");
}
void loop()
{
    lcd.setCursor(0, 1);
    lcd.print("Hello World!");
}

Hi, I have only used the Adafruit library, not 100% sure if it works the same, but if it does you must not set the code in the loop-section. Try this:

void setup()
{
   lcd.begin(16, 2);
   lcd.clear();
   lcd.setCursor(0, 1);
   lcd.print("Hello World!");
}
void loop()
{

}

I just tried the code and sadly nothing changed. :frowning:

I tried your original code and it works fine on my Uno and 16x2 LCD.

Have you tried adjusting the contrast pot?

The correct way to wire the contrast pot is to wire one end of the pot to ground and the wiper to pin 3. The other end of the pot not connected or connected to the wiper. The long standing advice that the pot is wired to ground, Vcc and pin 3 is wrong. It is an error perpetuated over many years that begs correction. In your case, just remove the green jumper between 5V and the pot.

Thank you for the tip, i fixed the pot and tried adjusting it but to no avail, no text and nothing has changed. :frowning:

I cannot see to where the RW (LCD pin 5) is connected. It should be connected to ground.

1 Like

Thank You! that is what it was missing! Thank You Very Much! :smiley:

1 Like

You are welcome. Happy coding.

Would you, please, mark the thread as solved for future members that are looking for a solution to the same problem?

Sure :smiley:

1 Like

Did you not look at the picture provided? :roll_eyes:

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