Lcd only displaying squares on top row

hey im making this Arduino pong project and for some reason the lcd is only displaying squares on the top row ive switched pins and moved wires around and nothing still here is the wiring diagram and code

code

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

byte customchar2[8] = { B00100, B01110, B11111, B11111, B01110, B00100, B00000};
byte customchar1[8] = { B00000, B00100, B01110, B11111, B11111, B01110, B00100};

int i = 0;
int a = 1;
int play = 0;
int ispeed = 150;

void setup()
{
  lcd.begin(16, 2);
  lcd.clear();
  lcd.createChar(1, customchar1);
  lcd.createChar(2, customchar2);
  pinMode(8, INPUT);
  digitalWrite(8, HIGH);
  pinMode(9, INPUT);
  digitalWrite(9, HIGH);
  pinMode(10, INPUT);
  digitalWrite(10, HIGH);
  pinMode(11, INPUT);
  digitalWrite(11, HIGH);
  Serial.begin(9600);
}

void loop()
{
  if(play == 0)
  {
  ispeed = 150;
  lcd.clear();
  lcd.setCursor(0,0);
  lcd.print("press any button");
  lcd.setCursor(2,1);
  lcd.print("to start....");
  delay(250);
   Serial.println(play);
  if(digitalRead(8) == LOW || digitalRead(9) == LOW || digitalRead(10) == LOW || digitalRead(11) == LOW )
  {
    play = 1;
    lcd.clear();
  }
  }
   
  if(play == 1)
  {
    
    Serial.println(ispeed);
      delay(ispeed);
       lcd.clear();
          lcd.setCursor(i,0);
     lcd.write(1);
     
     if((digitalRead(8) == LOW || digitalRead(9) == LOW )&& i > 2)
     {
       a = 4;
       i = -1;
     }
     if((digitalRead(10) == LOW || digitalRead(11) == LOW )&& i < 13)
     {
       a = 3;
       i = 16;
     }
  //traveling toward right 
  if(a == 1)
  {
    i++;
 if(i > 13 && digitalRead(10) == LOW)
      {
        a = 2;
      }
      else if(i < 2 && digitalRead(9) == LOW)
      {
        a = 1;
      }
      else if(i > 14 && digitalRead(11) == LOW)
      {
        if(ispeed > 20)
        {
        ispeed = ispeed - 10;
        }
        a = 2;
      }
      else if(i < 1 && digitalRead(8) == LOW)
      {
        if(ispeed > 20)
        {
        ispeed = ispeed - 10;
        }
        a = 1;
      }
      else if(i == -1 && a == 2)
      {
        a = 4;
      }
      else if(i == 16 && a == 1)
      {
        a = 3;
      }
  
  }
  //traveling toward left
  else if(a == 2)
  {
      i--;  
      //<--
  //    Serial.println("2");
      
      if(i > 13 && digitalRead(10) == LOW)
      {
        a = 2;
      }
      else if(i < 2 && digitalRead(9) == LOW)
      {
        a = 1;
      }
      else if(i > 14 && digitalRead(11) == LOW)
      {
        if(ispeed > 0)
        {
        ispeed = ispeed - 10;
        }
        a = 2;
      }
      else if(i < 1 && digitalRead(8) == LOW)
      {
        if(ispeed > 0)
        {
        ispeed = ispeed - 10;
        }
        a = 1;
      }
      else if(i == -1 && a == 2)
      {
        a = 4;
      }
      else if(i == 16 && a == 1)
      {
        a = 3;
      }
      
  
  }
  //right side looses
  else if(a == 3)
  {
    lcd.setCursor(4,0);
    lcd.print("LOSER!!!");
    lcd.setCursor(13,1);
    lcd.print("-->");
    delay(4000);
       play = 0;
       a = 2;
  }
  //left side looses
  else if(a == 4)
  {
    lcd.setCursor(4,0);
    lcd.print("LOSER!!!");
    lcd.setCursor(0,1);
    lcd.print("<--");
    delay(4000);
      play = 0;
      a = 1;
  }
  }
  
    
  
}

another thing i want to add is that i can kinda see blocks at the bottom but when i try to adjust it using the potiemter it doesent do anything

Which wires?

Strange.

Please post proper schematics. Coloured bird nests lacks information.
It's surprising anything can be seen on the display. There's no powering of the setup....

1 Like

I would say that the OP has presented an exemplary Fritzing diagram.
My only comment would be that it would be better to start with a simple program (say "hello world") from the LiquidCrystal.h before trying a more complicated one.

1 Like

Fritzings can never replace schematics. No pin designations and as usual, powering not present.
A method similar to Fritzings was used in wire wrapping boards, done by completely ignorant people regarding both electronics and coding.
No, Fritzings creates more work then explanations.

1 Like

Always show us a good image of your ‘actual’ wiring.

ive figured out the problem it was a missing wire thanks anyway though :grinning:

1 Like

Do the two lines of text (press any button, etc) show up on reset? This would be the equivalent of a hello world sketch. First steps and all right there in the code. I presume you are powering the circuit via USB from your programmer.

One thing I notice is there are no pull up resistors on your buttons. This can be resolved by designating the pins as INPUT_PULLUP. Without that the inputs will float and their state will be undefined.

I am able to understand your diagram well but you should start learning a schematic drawing application for when your projects become more complex. Frizzing only goes so far before it becomes difficult to understand, and as you can see some people have a bad reaction to seeing even the simplest example of the type.

Other than the above questions I would suggest double a triple check your connections. Also compare your usage of the library functions for the LCD calls to known working examples. I have not familiarized myself with that library yet.

Thanks for telling!

Good for you, you took my advice before I even finished writing it.

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