16x2 LCD black boxes displaying

Hey Hi

My 16x2 LCD display is having problems

All the connections are as per as the code and the pics.

The Red rail is 5V and the blue one is GND.

Here’s the code.

#include <Password.h> //http://playground.arduino.cc/uploads/Code/Password.zip use password library
#include <Keypad.h> //http://www.arduino.cc/playground/uploads/Code/Keypad.zip  //tells to use keypad library
#include <LiquidCrystal.h>

Password password = Password("2580"); //password to unlock box, can be changed

LiquidCrystal lcd(23,25,27,29,31,33);
//LiquidCrystal(rs, enable, d4, d5, d6, d7)

 

const byte numRows = 4; // Four rows
const byte numCols = 4; // columns
// Define the Keymap
char keys[numRows][numCols] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'*','0','#','D'}
};
// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
const byte rowPins[numRows] = {22,24,26,28}; 
const byte colPins[numCols] = {30,32,34,36}; 


// Create the Keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, numRows, numCols );

void setup(){
  Serial.begin(9600);
  lcd.setCursor(0, 0);
  lcd.begin(16, 2);
  lcd.setCursor(0,0);
  lcd.print("Welcome");
  delay(200); 
  lcd.setCursor(0,1);
  lcd.print("Please enter PIN");
  keypad.addEventListener(keypadEvent); //add an event listener for this keypad
  Serial.println("Enter your 4-digit password, Press A to enter,B to try again");
  
  }

void loop(){
  keypad.getKey();
  }
  //take care of some special events
  void keypadEvent(KeypadEvent eKey){
    switch (keypad.getState())
    {
     case PRESSED:
      clearlcd();
      Serial.print("You entered: ");
      lcd.setCursor(0,1);
      lcd.print("You entered ");
      lcd.print(eKey);
      Serial.println(eKey);
      delay(10);
  
  
  
      switch (eKey)
       {
        case 'A': checkPassword(); delay(1); break;
    
        case 'B': password.reset(); delay(1);Serial.println("Enter Again");Serial.println("Password Reset");
              lcd.setCursor(0,1);lcd.print("Enter Again       ");delay(1500);lcd.setCursor(0,1);clearlcd(); 
        break;
    
        default: password.append(eKey); delay(1);
       }
     } 
}
void checkPassword(){
  
if (password.evaluate()){  //if password is right open box
    
    Serial.println("Accepted");
    lcd.setCursor(0,1);
    lcd.print("Accepted     ");
    delay(1500);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Welcome Souvik");
    lcd.setCursor(0,1);
    lcd.print("Press B to Reset");
    delay(10);
}else{
    Serial.println("Denied");
    Serial.println("Try Again");
    Serial.println("Remember Press B to reset");
    lcd.setCursor(0,1);
    lcd.print("Denied       ");
    delay(2000);
    lcd.setCursor(0,1);
    lcd.print("Try Again");
    lcd.setCursor(0,1);
    lcd.print("Remember Press B to reset");
}
}
void clearlcd(){
  
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Welcome");
}

Here are some pics

Thank you for reading!

Do help!

Here are the pics

Here are some more

Here are some more pics

Turn on the room lights and take one picture pointing straight down at your entire setup.

Also temporarily get rid of your current sketch and use something simple.

#include <LiquidCrystal.h>

//LiquidCrystal lcd(RS, E, D4, D5, D6, D7);
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);      // put your pin numbers here

void setup()
  {
  lcd.begin(16, 2);                          // put your LCD parameters here
  lcd.print("hello, world!");
  lcd.setCursor(0,1);
  lcd.print("it works!");
  }

void loop()
  {
                                             // do nothing in 'loop'
  }

Don