[SOLVED] LCD is displaying random numbers instead of my text

#include <LiquidCrystal.h>
int RelayPin = 6; //Relay!
int delayTime = 5; //Seconds to hold the relay open
int buttonState = 0; //The state of the button (1, 0)
int buttonPin = 7; //Pin of the button. Make sure to connect the other end to GND, not 5V
int countdown = 15; //Time you have to run! (in seconds)
int contPin = 8; //The Pin for the continutity sensor
int contState = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); //LCD Config Pins
void setup() 
{
  //LCD Columns,Rows
  lcd.begin(16, 2);
  lcd.setCursor(0, 0);
  lcd.print("Welcome to");
  lcd.setCursor(0, 1);
  lcd.print("RocketLaunch 3.1");
  delay(1750);
  pinMode(RelayPin, OUTPUT); //Set the relay as an output
  pinMode(buttonPin, INPUT); //Self-Explanitory 
  pinMode(contPin, INPUT);
  digitalWrite(buttonPin, HIGH); //Pull-Up Resistor
  digitalWrite(contPin, HIGH); //Pull-Up Resistor
  lcd.clear();
  lcd.setCursor(0,0);
}


void loop() {
  contState = digitalRead(contPin);
  if(contState == LOW) {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Ready to Launch!");
    lcd.setCursor(0,1);
    lcd.print("Press button...");
    countdown = 15;
    buttonState = digitalRead(buttonPin);
    if(buttonState == LOW) {
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Launching in:");
      for(countdown > 0; countdown--;) {
        lcd.setCursor(0,1);
        lcd.print(countdown);
        lcd.print(' ');
        lcd.print("Second(s)  ");
        delay(1000);
    }
    
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Igniting Engine");
      digitalWrite(RelayPin, HIGH);
      delay(1000*delayTime);
      digitalWrite(RelayPin, LOW);
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("WHOOOSH!");
      delay(2500);
      lcd.clear();
      lcd.setCursor(0,0);
      lcd.print("Ready to Launch!");
      lcd.setCursor(0,1);
      lcd.print("Press button...");
  }
}  
  else {
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print('ERROR: Ignitor');
    lcd.setCursor(0,1);
    lcd.print('not plugged in!');
    delay(1000);  
  }
}

For some reason the forums glitched and removed everythng but the raw code (including the brackets). Sorry! Anyway, the numbesr seem to be random and my wiring is fine. (I rewired…and rewired…and…guess what? rewired…) I’m going to try something in the code by replacing all the ’ with ".

Please read the how to use this forum sticky and learn how to post code correctly.

It sounds like you have made an error in wiring up your display. Post a picture of your wiring.

After you follow Mike's advice think about the following:
Are the numbers truly 'random' or are they just incorrect?
Does the setup() part of your display work correctly when you remove everything between the brackets in loop()?
Do you need all of those lcd.clear() commands?
Do you need any of the lcd.setCursor(0,0) commands?

Don

Setup() works fine, except once I get to the Press Button... part everything falls apart. Then, when I do push the button, it goes back to normal display...I don't know...very odd...I had a similar problem when displaying a mailto: link on a webpage using my Ethernet shield a while back. 2 neat rows of 5 numbers each.

Press Button... part everything falls apart.

countdown = 15;

. . .
lcd.print(countdown);

The LCD controller is treating the number 'countdown' as an ASCII code, which it isn't.

Don

Solved. Some quick changes in the code, a complete and utter rewire, now its sort of working. Thanks for the help guys!
:smiley: