LCD not working well


I don't understand what's going on and why. Can someone help me? The setup is this

#include <LiquidCrystal.h>

int RS = 7;
int E = 8;
int D4 = 9;
int D5 = 10;
int D6 = 11;
int D7 = 12;

bool turn = true;
long timer = 0;

byte hart[] = {
  B00000,
  B01010,
  B11111,
  B11111,
  B11111,
  B01110,
  B00100,
  B00000
};

LiquidCrystal lcd(RS, E, D4, D5, D6, D7);

void setup() { 
  lcd.begin(16, 2);  
  lcd.createChar(0, hart);
  lcd.setCursor(1, 0);
  lcd.write(byte(0));
  lcd.setCursor(2, 0);
  lcd.print(" Happy");
  lcd.setCursor(9, 0);
  lcd.write(byte(0));
  lcd.setCursor(0, 1);
  lcd.print("Mother Day!");
}

void loop() {
  if(turn) lcd.scrollDisplayRight();
  else lcd.scrollDisplayLeft();
  if(timer > 3) {
    turn = !turn;
    timer = 0;
  }
  delay(200);
  timer += 1;
}

Post your code too, please, in code tags.

We can't see your wiring well. Post better pictures which shows EACH wire.
We can't see your sketch. Post it in code tags.
We see that your soldering might need some improvement:
forum_soldering

Have you tightly pressed the display into your breadboard? Looks like just laying on the breadboard which might cause contact problems.

Sorry, if you can't see something now let me know :slightly_smiling_face:

I expect the problem is probably a cold solder joint or a short, I cannot see that well. Leave your iron on the joint until the solder flows almost like water. If it does not do that your iron is either to cold, under powered or both. Be sure you use an electronic solder, definitely NOT a plumbers solder.

The Wokwi simulation shows that it is quite likely a hardware issue (wiring problem):

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