Arduino lcd display

Hello, i have a problem on displaying things on the arduino's lcd. It only shows white boxes instead of the text i ask for.
My code is this:

#include <LiquidCrystal.h> // includes the LiquidCrystal Library
LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)

void setup() {
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display }
}

void loop() {
lcd.print("Arduino"); // Prints "Arduino" on the LCD
delay(3000); // 3 seconds delay
lcd.setCursor(2,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("LCD Tutorial");
delay(3000);
lcd.clear(); // Clears the display
lcd.blink(); //Displays the blinking LCD cursor
delay(4000);
lcd.setCursor(7,1);
delay(3000);
lcd.noBlink(); // Turns off the blinking LCD cursor
lcd.cursor(); // Displays an underscore (line) at the position to which the next character will be written
delay(4000);
lcd.noCursor(); // Hides the LCD cursor
lcd.clear(); // Clears the LCD screen
}

and my wiring is this:

I tried the example that i found here: https://howtomechatronics.com/tutorials/arduino/lcd-tutorial/?utm_content=cmp-true

What do i have to change to fix it ?
Thank you!

Hi, @spiros99

To add code please click this link;

Have you adjusted the pot connected to the LCD?

Can you please post an image(s) of your project?
So we can see your component layout.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like

This is an image of my project, its a little hard to see everything clearly, but its connecected excactly like the diagram that i posted earlier.

If i change the value of the pot it only shows or hides the white boxes of the lcd.
Nothing else changes...

post your code

Invest in an I²C adapter for the LCD.

#include <LiquidCrystal.h> // includes the LiquidCrystal Library
LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)

void setup() {
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display }
}

void loop() {
lcd.print("Arduino"); // Prints "Arduino" on the LCD
delay(3000); // 3 seconds delay
lcd.setCursor(2,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("LCD Tutorial");
delay(3000);
lcd.clear(); // Clears the display
lcd.blink(); //Displays the blinking LCD cursor
delay(4000);
lcd.setCursor(7,1);
delay(3000);
lcd.noBlink(); // Turns off the blinking LCD cursor
lcd.cursor(); // Displays an underscore (line) at the position to which the next character will be written
delay(4000);
lcd.noCursor(); // Hides the LCD cursor
lcd.clear(); // Clears the LCD screen
}

how is this going to affect my problem? Is this able to make the lcd work properly?

You can't use pin 1

#include <LiquidCrystal.h> // includes the LiquidCrystal Library
LiquidCrystal lcd(1, 2, 4, 5, 6, 7); // Creates an LCD object. Parameters: (rs, enable, d4, d5, d6, d7)

void setup() {
lcd.begin(16,2); // Initializes the interface to the LCD screen, and specifies the dimensions (width and height) of the display }
}

void loop() {
lcd.print("Arduino"); // Prints "Arduino" on the LCD
delay(3000); // 3 seconds delay
lcd.setCursor(2,1); // Sets the location at which subsequent text written to the LCD will be displayed
lcd.print("LCD Tutorial");
delay(3000);
lcd.clear(); // Clears the display
lcd.blink(); //Displays the blinking LCD cursor
delay(4000);
lcd.setCursor(7,1);
delay(3000);
lcd.noBlink(); // Turns off the blinking LCD cursor
lcd.cursor(); // Displays an underscore (line) at the position to which the next character will be written
delay(4000);
lcd.noCursor(); // Hides the LCD cursor
lcd.clear(); // Clears the LCD screen
}


I²C is easier to connect, less prone to wiring issues and use fewer pins

2 Likes

You can as long as you never use or initialize Serial.

ok i will try to use one! Thank you

I moved your topic to an appropriate forum category @spiros99.

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

1 Like

Ah, missed that. I'll return to my morning coffee now

1 Like

Are the header pins soldered to the LCD display? Hard to tell from the photo.
Have you tried replacing jumpers? Sometimes they will break inside the insulation, or may not make good contact with the breadboard.

3 Likes

With pin 1 connected to the LCD your code may not be uploading properly. If you really need to use that pin then try disconnecting pin 1 while you are uploading and then reconnect to test the code.

Don

1 Like

Listen to @david_2018!

image

That header MUST be soldered. The LCD will not work reliably otherwise.

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