LCD Screen showing ç before words and lcd.clear() not working (all on Tinkercad)

I know this has already been discussed a few times, but it's sort of different for me: I want to simulate my game on Tinkercad before I build it, but the 16x2 LCD I am using for my game half the time shows the ç (cedilla) symbol before each word. And the lcd.clear() does not always clear the words. To be clear, this is all on Tinkercad.

The following is the code for my whole game:

#define NOTE_C3  131
#define NOTE_C4  262
#define NOTE_G3  196
#define NOTE_A3  220
#define NOTE_B3  247
#define NOTE_B0  31
#define NOTE_D3  147
//Defining notes for piezo (used later on)
#include <LiquidCrystal.h>
//add LCD library to be able to print on the LCD
LiquidCrystal lcd(0,15,16,17,18,19);
//initialize the LCD

String array[] = {"Welcome!", "To this game", "This is a Simon", "Says Game!", 
                 "In This Game,", "You Have To See", "The Pattern of",
                 "The LEDs in a","row of 6 blinks", "and then copy",
                 "them exactly", "with the buttons", "underneath them.",
                 "Just like a", "Simon Says Game", "There are a",
                 "Total of 20", "levels, and each", "level is harder",
                 "than the last.","You have a max", "of 5 tries.",
                 "Try your best!"};
//creates array of words for instructions at beginning of game

int startBut = 1; //pin number of start Button
int buz = A0; // pin number of piezo
int maxLevel = 6; // number of LED blinks in one level
int ledSeq[6]; // sequence of the LEDs
int mySeq[6]; // sequence that the player enters
int speed = 1000; // initial speed of LED blinks
int gameTimes = 0; // initial number of game errors
int level = 1; // initial level that player starts with
int points = 0;// initial points that player starts with
int lcdHelp = 0;// variable used to print out every 2nd string in LCD array

int melody[] = {

  NOTE_C4, NOTE_G3, NOTE_G3, NOTE_A3, NOTE_G3, 0, NOTE_B3, NOTE_C4
};
// tune for game when player wins a level/the game

 int noteDurations[] = {

  4, 8, 8, 4, 4, 4, 4, 4
};
// duration(in musical notes) of each note in melody
 void setup()
{
  lcd.begin(16,2);
   // turns on LCD screen
  
    
   for (int i = 0; i <25; i+=2) {
        
    lcd.setCursor(0,0);
    lcd.print(array[i]);
    lcd.setCursor(0,1);
    lcdHelp = i+1;
    lcd.print(array[lcdHelp]);
    delay(500);
    lcd.clear();
    }
   // prints out LED Alertness Game instructions
   
 
 for(int ledPin = 7; ledPin > 1; ledPin--) {
    pinMode(ledPin, OUTPUT);
  }
pinMode(startBut, INPUT);

   
  for (int butPin = 13; butPin > 7; butPin--) {
    pinMode(butPin, INPUT);
  }
 
 //initializes the LEDs and the Buttons
   
  Serial.begin(9600);
  //turns on the Serial Monitor
 
}
 
   
void loop () {
  if (gameTimes<4 && speed>0) /*when player has not finished the game
  or entered the incorrect order 4 times*/
  {
  if (digitalRead(startBut) == LOW) {
     delay(500);
    tone (buz, NOTE_C3, 1000/4);
    delay(500);
    Serial.println("start");
    delay(500);
    getSequence();
     displaySeq();
     butPres();
  }
   /*After the player presses the start Button,a flat note buzzes and then
   the LCD sequence is created, displayed, and inputted by the player*/
  }
  
  else if (gameTimes == 4) /*When the player has entered the pattern
  incorrectly 4 times */
  {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("GAME OVER");
    tone (buz, NOTE_C4, 1000);
    delay(500);
    tone (buz, NOTE_D3, 1000);
    delay(500);
    tone (buz, NOTE_B0, 1000);
    delay(500);
    exit(0);
    
    // prints GAME OVER on the LCD screen and buzzes 3 sad notes
  }
  else //when the player finished the game 
  { 
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("CONGRAGULATIONS!");
    lcd. setCursor(0,1);
    lcd.print("YOU BEAT THE GAME!");
    delay (1000);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("TOTAL POINTS: " + points);
    lcd.clear();
    /*prints congragulatory message
    and prints out player's points*/
    for (int thisNote = 0; thisNote < 8; thisNote++) {

    int noteDuration = 1000 / noteDurations[thisNote];

    tone(buz, melody[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    noTone(buz);

  } // plays happy tune from melody method
    exit (0); //turns off the game
  }
}
 
void displaySeq () {
  for (int k = 7; k>1; k--) {
    digitalWrite(k, LOW);
  }
/* Turns off all of the LEDs before starting the
display sequence */
 
  delay(500);
  
  for (int i = 0; i<maxLevel; i++) {
    digitalWrite(ledSeq[i], HIGH);
    delay(speed);
    digitalWrite(ledSeq[i], LOW);
    delay(500);
    Serial.println("show");
  }
 // displays the previously random generated LED sequence
}


void butPres () {
  
  Serial.println("begin");
  
  lcd.setCursor(0,0);
  lcd.print("BEGIN");
// prints BEGIN on the LCD screen

  
  int result = 0;
  // Variable used to break out of while loop
  
  for (int i = 0; i< maxLevel; i++) {
    
    result = 0;
    while (result == 0) {
    // loop used to pause the code until a button is pressed
      
      if (digitalRead(13) == HIGH) {
        Serial.println("press1");
        digitalWrite(7, HIGH);
        result = 1;
        mySeq[i] = 7;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
          incorrectSeq();
          return;
        }
        digitalWrite(7, LOW);
      }
       
      if (digitalRead(12) == HIGH) {
        Serial.println("press2");
        digitalWrite(6, HIGH);
        result = 1;
        mySeq[i] = 6;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
           incorrectSeq();
          return;
        }
        digitalWrite(6, LOW);
      }
        
       if (digitalRead(11) == HIGH) {
         Serial.println("press3");
        digitalWrite(5, HIGH);
        result = 1;
        mySeq[i] = 5;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
         incorrectSeq();
          return;
        }
         digitalWrite(5, LOW);
       }
         
      if (digitalRead(10) == HIGH) {
        Serial.println("press4");
        digitalWrite(4, HIGH);
        result = 1;
        mySeq[i] = 4;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
           incorrectSeq();
          return;
        }
        digitalWrite(4, LOW);
      }
        
       if (digitalRead(9) == HIGH) {
         Serial.println("press5");
        digitalWrite(3, HIGH);
        result = 1;
        mySeq[i] = 3;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
           incorrectSeq();
          return;
        }
         digitalWrite(3, LOW);
       }
         
       if (digitalRead(8) == HIGH) {
      Serial.println("press6");
        digitalWrite(2, HIGH);
        result = 1;
        mySeq[i] = 2;
        delay(500);
        if (mySeq[i] != ledSeq[i] ) {
           incorrectSeq();
          return;
        }
         digitalWrite(2, LOW);
       }
    }
    /*code to receive the button press,
        record it in an array, and if
        the button press does not match
       the LED displayed, then jumps to the 
       incorrect sequence method, otherwise
       continues recording button presses*/
    }
  rightSeq();
  /* if all button presses were correct, implements
  the right sequence method. */
  Serial.println("end");
       }  
        
        

void getSequence () {
  Serial.println("get");
  randomSeed(millis());
  // initializes code to generate random sequence
  
  for (int i = 0; i< maxLevel; i++) {
    ledSeq[i] = random (2,8);
  }
  //generates random LED seqeuence and stores it in an array
}
  
  
  void incorrectSeq () {
    
    
    Serial.println("incorrect");
    
   lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("WRONG ORDER");
    

    tone (buz, NOTE_C4, 1000/4);
    delay(500);
    tone (buz, NOTE_D3, 1000/4);
    delay(500);
    tone (buz, NOTE_B0, 1000/4);
    
    //buzzes a sad tone
    
    speed = 1000;
    gameTimes++;
    // resets the speed and adds 1 gameTime
    
    for (int j = 7; j> 1; j--) {
      digitalWrite(j, HIGH);
    }
   delay (500);
   
    for (int j = 7; j> 1; j--) {
      digitalWrite(j, LOW);
    }
   delay(500);
    
    for (int j = 7; j> 1; j--) {
      digitalWrite(j, HIGH);
    }
    
    //blinks all LEDs on off on
   
  }
  void rightSeq() 
  {
    Serial.println("correct");
    
    
    
    for (int thisNote = 0; thisNote < 8; thisNote++) {

    int noteDuration = 1000 / noteDurations[thisNote];

    tone(buz, melody[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.30;

    delay(pauseBetweenNotes);

    noTone(buz);

  }
    //buzzes a happy tune on the piezo

    for (int j = 7; j> 1; j--) {
      digitalWrite(j, HIGH);
    }
   delay (500);
   
    for (int j = 7; j> 1; j--) {
      digitalWrite(j, LOW);
    }
   delay(500);
    
    for (int j = 7; j> 1; j--) {
      digitalWrite(j, HIGH);
    }
   delay(500);
    
   for (int j = 7; j> 1; j--) {
      digitalWrite(j, LOW);
    }
   delay(500);
   
   for (int j = 7; j> 1; j--) {
      digitalWrite(j, HIGH);
    }
   //blinks the LED on off on off on
    
    
  speed-=200;
  level++;
  points += level;
  /*decreases the speed by 200, increments the level,
  */
  lcd.setCursor(0,0);
  lcd.print("POINTS: " + points);
  delay(500);
  lcd.clear();
  delay(1000);
  //prints out the number of points then clears the LCD screen
  }

void instructMethod () {
    for (int i = 0; i <25; i+=2) {    
    lcd.setCursor(0,0);
    lcd.print(array[i]);
    lcd.setCursor(0,1);
    lcdHelp = i+1;
    lcd.print(array[lcdHelp]);
    delay(1000);
    lcd.setCursor(0,0);
    lcd.print("                ");
    lcd.setCursor(0,1);
    lcd.print("                ");
    }
}

I mainly start having an issue in the butPres() method, specifically when the word BEGIN is displayed, there is a ç before it. And afterwards, when lcd.clear() is supposed to clear BEGIN, it just stays on the display. And later, when I press the wrong button, and the incorrectSeq() method is implemented, the words WRONG ORDER are printed after the button, even though there is a lcd.clear() before it.

The following is a video showing my problem:

LCD Error

This is my first time posting, and I am an extreme beginner at coding, so I'm sorry in advance if most of my code is redundant or doesn't make sense. Thank you for the help!

Backup your code, then copy and paste your code into the browser URL bar, then cut and paste that over your code. All non-standard characters should be removed or made visible.

(or, there is a sticky bit changing "space" to "ç")

or simulator choking on large sketch
or simulator just simple faulty

I'm sorry, but I don't fully understand what you mean by that, are you asking me to delete my code from tinkercad and then paste it back again, because if so, I've already tried that.
Thank you!

What is exit(0); supposed to do ?
Do you use pin 0 and 1 ? Those are used to upload a sketch and for the Serial Monitor.
The sketch is not good enough for the size of the code.
You can start by putting all the used pins for the leds and buttons in arrays and use the word "Pin" for the variables that are pins.
The wiring in Tinkercad is also not good enough for the amount of components and wires. Arrange the wires in a nice way, use colors, red for 5V, black for GND. Give the resistors the value that they are supposed to have.

TinkerCad has shown that it is not perfect before. It makes it so much fun to chase a bug that is part of the simulator, though, doesn't it?

No. Copy... paste.

Copy your code, paste to something that does not handle extended ASCII (Notepad, vi, browser URL bar). Then copy that and paste it into your IDE.

Just tried again and it still gives me the ç symbol before BEGIN, and BEGIN is not clearing. Is there anything else I can do?

exit(0) exits the game, because otherwise it would just stay on, as it is inside a void loop() function.
I did use pins 0 and 1, as I don't have any other pins left.

For these two, overtype the "BEGIN"... the special characters can mask themselves as non-printed characters (between the quote and the B).

What do you mean by overtype the "BEGIN", to print a blank space in its position to clear it?


Is this better?

This is better:


When I leave pin 0 and 1 open, then I don't get those characters on the display. However, the button and buzzer in the upper-right are not connected.

Type "BEGIN" over "BEGIN"... but now it looks like @Koepel has the real answer.

Thank you so much, the LCD screen is printing everything correctly now!

How did you fix it ?
Replace the display with a I2C display and don't use pin 0 and 1 ?

By the way, I made the circuit in the Wokwi simulator: Game sketch on the Arduino forum - Wokwi ESP32, STM32, Arduino Simulator
Tinkercad is good, but Wokwi is so much more, it is at a different level.

I decided to not include the start button and the buzzer in the end. I used an I2c before, but I currently only have the original LCD, so I couldn't have switched back to the I2c.
Thank you for telling me about Wowki, I'm definitely going to use it from now on!

wokwi has it`s own issues

Which are ?

  1. fastLED strips must be not equal 8 in length (8/16/24/32/...)
  2. if you break middle connection of potentiometer with a button - wokwi will not understand and show random numbers