16/2 LCD problem

Hello,

I am making a project with 16/2 LCD's, and suddenly the screen quit displaying the code and is only showing the white boxes. All connections should be correct, because I am making 8 x of the same thing and two of them that are ready work perfectly. This one was also working earlier but not anymore. I thought it might be a problem with the wires, checked the wires and set them up all again but still showing only white boxes. I read the forum that adjusting the potentiometer might help, so I was trying out that for a while also but it just doesn't work.

Any advice?

Post code, post a schematic.
Ask a mod to move this to a more appropriate section.

#include <LiquidCrystal.h>
int LDR = A0;
int sensorValue = 0;

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

void setup() {
Serial.begin(9600);
pinMode(LDR, INPUT);

lcd.begin(16, 2);
lcd.setCursor(0,0);
lcd.print(“hey, team 3!”);
delay(500);
lcd.clear();
delay(500);
lcd.setCursor(0,0);
lcd.print(“lets measure”);
lcd.setCursor(0,1);
lcd.print(“sound …”);
delay(500);
lcd.setCursor(2,6);
lcd.cursor();
delay(500);
lcd.setCursor(2,6);
lcd.noCursor();
delay(500);
}

void loop() {

sensorValue = analogRead(LDR);
Serial.println(sensorValue);

lcd.setCursor(0,0);
lcd.print("Sound level: ");
lcd.clear();
lcd.setCursor(0,1);
lcd.print(analogRead(LDR));

}

////////////////////

+Schematic attached, plus I have a resistor in between of 16 and 5V

Your code is incomplete. Could that be part of your problem?

Do you mean the last bracket? I accidentally failed to copy it.

But the two other ones work with this code?

(deleted)

void loop() {

sensorValue = analogRead(LDR);
Serial.println(sensorValue);

lcd.setCursor(0,0);
lcd.print("Sound level: ");
lcd.clear();
lcd.setCursor(0,1);
lcd.print(analogRead(LDR)); 

}

Pretty poor approach to the LCD (this will cause flicker, or if your screen is too slow to not display much if anything); one superfluous analogRead() (just use sensorValue again); and no time between readings (this makes your numbers change faster than you can read them).

Don't use lcd.clear() every loop() - a couple hundred times a second. That will cause flicker or other problems.
Don't rewrite that fixed "sound level" line every time. Only takes time. Do that in setup() and just don't touch it.
All you should do is overwrite the reading here, of course making sure that you always print four characters (use printf() or sprintf() to format the number as string - or just print three more spaces if you want it left aligned).