Hello, I hope everyone is doing well. I am trying to use the LCD screen from the Arduino started kit to display text. I followed this tutorial exactly: [in comments] except that I plugged my LCD directly into the breadboard. The LCD came with header pins, so I didn't solder anything during this project. I am sure that all the wires work. Maybe someone can explain why there would be white boxes instead of text, so I can also troubleshoot.
I also looked up other questions on this topic in this forum, but none of the solutions worked for me.
The line of boxes means that the LCD is powered but is not initialized properly or the contrast is not adjusted right.
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.
The wiring looks right in the Fritz. Post a photo of YOUR wiring. Post the code that you use to test the LCD.
// Include the library:
#include <LiquidCrystal.h>
// Create an LCD object. Parameters: (RS, E, D4, D5, D6, D7):
LiquidCrystal lcd = LiquidCrystal(2, 3, 4, 5, 6, 7);
//LiquidCrystal lcd = LiquidCrystal(7, 6, 5, 4, 3, 2);
//LiquidCrystal lcd(2, 3, 4, 5, 6, 7);
void setup() {
// Specify the LCD's number of columns and rows. Change to (20, 4) for a 20x4 LCD:
lcd.begin(16, 2);
lcd.clear();
}
void loop() {
// Set the cursor on the third column and the first row, counting starts at 0:
//lcd.setCursor(2, 0);
// Print the string 'Hello World!':
lcd.print("Hello World!");
// Set the cursor on the third column and the second row:
//lcd.setCursor(2, 1);
// Print the string 'LCD tutorial':
// lcd.print("LCD tutorial");
}
Does adjusting the contrast pot make any difference?
That code will print hello world over and over at high speed so that it is not readable.
Try this code to test the LCD. I have tried it in my Uno with a 16x2 LCD and it will display "Hello World!" on the top line and a count of millis() on the second line.
// Include the library:
#include <LiquidCrystal.h>
// Create an LCD object. Parameters: (RS, E, D4, D5, D6, D7):
LiquidCrystal lcd = LiquidCrystal(2, 3, 4, 5, 6, 7);
void setup()
{
// Specify the LCD's number of columns and rows. Change to (20, 4) for a 20x4 LCD:
lcd.begin(16, 2);
lcd.clear();
lcd.print("Hello World!");
}
void loop()
{
static unsigned long timer = 0;
unsigned long interval = 1000;
if (millis() - timer >= interval)
{
timer = millis();
lcd.setCursor(0, 1);
lcd.print(millis());
}
}
The photo is not ideal as I can't see where the wires go which is the point of posting a photo.