LCD showing some characters, but not all

Hello,
On my LCD, it displays the words:
“Starting… 3 2 1”
"Final Score: 0
“Top Score 0”
I addition to this, it should also display the following words in between “Starting… 3 2 1” and “Final Score: 0,” but they are not shown:
“Push It”
“Flick It”
“Spin It”
I’ve checked the connections several times, but I cannot find anything. Can someone help me identify the problem, please?
This is the code my partner and I are working on for this project:

#include <Audio.h>
#include <Wire.h>
#include <SPI.h>
#include <SD.h>
#include <SerialFlash.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);    // these numbers correlate to their pins: RS, E, D4, D5, D6, D7

// GUItool: begin automatically generated code, for audio
AudioSynthKarplusStrong  string2;        //xy=535,548
AudioSynthWaveformSine   sine2;          //xy=536.6666870117188,468.00006103515625
AudioSynthWaveformSine   sine3;          //xy=537,508
AudioSynthKarplusStrong  string1;        //xy=754.6666870117188,372
AudioMixer4              mixer2;         //xy=755,498
AudioSynthSimpleDrum     drum1;          //xy=755.6666870117188,335
AudioSynthWaveformSine   sine1;          //xy=757.6667060852051,407.0000114440918
AudioMixer4              mixer1;         //xy=903.0001220703125,384.0000114440918
AudioOutputAnalog        dac1;           //xy=1039.666648864746,383.00001335144043
AudioConnection          patchCord1(string2, 0, mixer2, 2);
AudioConnection          patchCord2(sine2, 0, mixer2, 0);
AudioConnection          patchCord3(sine3, 0, mixer2, 1);
AudioConnection          patchCord4(string1, 0, mixer1, 1);
AudioConnection          patchCord5(mixer2, 0, mixer1, 3);
AudioConnection          patchCord6(drum1, 0, mixer1, 0);
AudioConnection          patchCord7(sine1, 0, mixer1, 2);
AudioConnection          patchCord8(mixer1, dac1);
// GUItool: end automatically generated code

//sensor values
int X_pin = 37;
int encoder0PinA = 19;
int encoder0PinB = 18;
int encoder0Pos = 0;
int encoder0PinALast = LOW;
int n = LOW;
int Led = 13;
int buttonpin = 14;
//game values
long action;     // shows the current action
int score = 0;   // the current score
int topscore = 0;
bool actionwon;  // was the action completed
bool gameon;     //is the game currently being played
int rotary1;
int rotary2;
int joystick1;
int joystick2;
bool button1;
bool button2;
//timer
unsigned long gameSpeed = 3000;
unsigned long timeOfPrompt;
unsigned long timeElapsed;


 void setup() {
  Serial.begin(9600);
  pinMode (encoder0PinA, INPUT);
  pinMode (encoder0PinB, INPUT);
  pinMode (X_pin, INPUT);
  pinMode(buttonpin, INPUT); 
  AudioMemory(10); 
  lcd.begin(16, 2);
  randomSeed(analogRead(A18));
}

void loop() {
  start_game();
  gameon = true;
  while (gameon != false) {
    action = random(1,4);
    actionwon = false;
    
    if (action == 1){         //1 = the button
      
      lcd.print("PUSH IT"); 
      button1 = digitalRead(buttonpin);
      push_sound();
      //timer starts
      timeOfPrompt = millis();
      timeElapsed = millis() - timeOfPrompt;

        //while you still have time, and havent done the action yet
        while (timeElapsed < gameSpeed && actionwon == false) {
          button2 = digitalRead(buttonpin);
          if (button2 != button1){ //the status of the sensor has changed, action was done
            actionwon = true;
            score = score + 1;
            gameSpeed = gameSpeed - (gameSpeed * .05);
          }
          timeElapsed = millis() - timeOfPrompt;
        }
        if (actionwon == true){ //won round, continues to next
          lcd.clear();
          lcd.print("   ");
          delay(1000);
        }
        else if(actionwon == false){ // lost round, starts over b/c endgame is false, leaves the while
          gameon = false;
          end_game();
        }
        lcd.clear();
    }
    
    if (action == 2){         //2 = the joystick

      //code is the same for three sensors, except for it reading the specific sensor
      lcd.print("FLICK IT");
      flick_sound();
      joystick1 = digitalRead(X_pin);
      timeOfPrompt = millis();
      timeElapsed = millis() - timeOfPrompt;
        while (timeElapsed < gameSpeed && actionwon == false) {
          joystick2 = digitalRead(X_pin);
          if (joystick2 != joystick1){
            actionwon = true;
            score = score + 1;
            gameSpeed = gameSpeed - (gameSpeed * .05);
          }
          timeElapsed = millis() - timeOfPrompt;
        }
        if (actionwon == true){
          lcd.clear();
          lcd.print("   ");
          delay(1000);
        }
        else if(actionwon == false){
          gameon = false;
          end_game();
        }
        lcd.clear();
    }
    
    if (action == 3){     //3 = the rotary encoder
      
      lcd.print("SPIN IT");
      spin_sound();
        n = digitalRead(encoder0PinA);
        if ((encoder0PinALast == LOW) && (n == HIGH)) {
        if (digitalRead(encoder0PinB) == LOW) {
          encoder0Pos--;
        } else {
          encoder0Pos++; }}
      encoder0PinALast = n;
      rotary1 = n;

      timeOfPrompt = millis();
      timeElapsed = millis() - timeOfPrompt;
        while (timeElapsed < gameSpeed && actionwon == false) {
            n = digitalRead(encoder0PinA);
            if ((encoder0PinALast == LOW) && (n == HIGH)) {
            if (digitalRead(encoder0PinB) == LOW) {
              encoder0Pos--;
             } else {
            encoder0Pos++;}}
            encoder0PinALast = n;
            rotary2 = n;
                      
          if (rotary2 != rotary1){
            actionwon = true;
            score = score + 1;
            gameSpeed = gameSpeed - (gameSpeed * .05);
          }
          timeElapsed = millis() - timeOfPrompt;
        }
        if (actionwon == true){
          lcd.clear();
          lcd.print("  ");
          delay(1000);
        }
        else if (actionwon == false){
          gameon = false;
          end_game();
        }
        lcd.clear();
    }

  }
  //game rests, sets top score
  if (score > topscore){
    topscore = score; }
   gameSpeed = 3000;
   score = 0;
}
void start_game(){
  //runs at the start of the loop, just visuals/audio to look nice
  lcd.print("STARTING...");
  sine1.amplitude(0.7);
  sine1.frequency(4000);
  delay(300);
  sine1.amplitude(0);
  delay(700);
  lcd.setCursor(0,1);
  lcd.print("3   ");
  sine1.amplitude(0.7);
  sine1.frequency(4000);
  delay(300);
  sine1.amplitude(0);
  delay(700);  
  lcd.print("2   ");
  sine1.amplitude(0.7);
  sine1.frequency(4000);
  delay(300);
  sine1.amplitude(0);
  delay(700);
  lcd.print("1   ");
  sine1.amplitude(0.7);
  sine1.frequency(4000);
  delay(300);
  sine1.amplitude(0);
  delay(700);
  lcd.clear();
  lcd.setCursor(0,0);  
  
}
void end_game(){
  //runs after a failed round, shows final score
  sine1.amplitude(0.8);
  sine1.frequency(4000);
  sine2.amplitude(0.8);
  sine2.frequency(4000);  
  sine3.amplitude(0.8);
  sine3.frequency(4000);
  delay(1000);
  sine1.amplitude(0);
  sine2.amplitude(0);
  sine3.amplitude(0);  
  lcd.clear();
  lcd.print("FINAL SCORE:  ");
  lcd.print(score);
  lcd.setCursor(0,1);
  lcd.print("TOP SCORE: ");
  lcd.print(topscore);
  lcd.setCursor(0,0);
  delay(3000);
  lcd.clear();
}

//the sounds for each action, each one is different so the player can learn to recognize them and not have to look at the screen anymore.

void push_sound(){
  sine1.amplitude(0.3);
  sine2.amplitude(0.3);
  sine3.amplitude(0.3);
  sine1.frequency(4000);
  sine2.frequency(4000);
  sine3.frequency(4000);
  delay(200);
  sine1.amplitude(0);
  sine2.amplitude(0);
  sine3.amplitude(0);
}
void flick_sound(){
  string1.noteOn(300, 1);
  string2.noteOn(200, 1);
  delay(400);
  string1.noteOff(1);
  string2.noteOff(1);
}
void spin_sound(){
  drum1.noteOn();
  drum1.frequency(4000);
  drum1.length(1000);  
}

Thank you.

OK, well to start with, it is clear that as the LCD does indeed print what you instruct it to; the connections to the LCD are in no way in doubt.

So the trouble resides in your code or your sensors (or the connection to the sensors). :astonished:

You need to write some simple code that - without changing any connections until you understand the problem - responds in a way you can see - either through the LCD or simply through the pin 13 LED or another LED and resistor that you connect to a nominated pin - to activation of each sensor at a time and make sure that works. :grinning:

Thank you very much. I'll try that.

@gen135

Other post/duplicate DELETED
Please do NOT cross post / duplicate as it wastes peoples time and efforts to have more than one post for a single topic.

Continued cross posting could result in a time out from the forum.

Could you also take a few moments to Learn How To Use The Forum.

Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.