digitalRead inputs constantly looping instead of waiting for Button Press

I followed this guide to load Hoodloader2 onto my Mega2560 to make a gamepad. All I did was add extra buttons to the original Sketch. Everything works but instead of it waiting for a button to be pressed, all of the inputs are looping in the Serial monitor. Here's my code:

const int Button1 = 1;
const int Button2 = 2;
const int Button3 = 3;
const int Button4 = 4;
const int UpButton = 7;
const int DownButton = 5;
const int LeftButton = 8;
const int RightButton = 6;

void setup(){
   Serial.begin(9600);
   pinMode(UpButton, INPUT);
   pinMode(UpButton, INPUT);
   pinMode(LeftButton, INPUT);
   pinMode(RightButton, INPUT);
   pinMode(Button1, INPUT);
   pinMode(Button2, INPUT);
   pinMode(Button3, INPUT);
   pinMode(Button4, INPUT);
} 
void loop(){
   if(digitalRead(UpButton) == HIGH){
  Serial.println("Up:");
  delay(100);
   }
   else
   if(digitalRead(UpButton) == LOW) {
    delay(100);
}

   if(digitalRead(DownButton) == HIGH){
  Serial.println("Down:");
  delay(100);
   }
   else
   if(digitalRead(DownButton) == LOW) {
    delay(100);
}
   
   if(digitalRead(LeftButton) == HIGH){
  Serial.println("Left:");
  delay(100);
   }
   else
   if(digitalRead(LeftButton) == LOW) {
    delay(100);
}

   if(digitalRead(RightButton) == HIGH){
  Serial.println("Right:");
  delay(100);
   }
   else
   if(digitalRead(RightButton) == LOW) {
    delay(100);
}

   if(digitalRead(Button1) == HIGH){
  Serial.println("Button1:");
  delay(100);
   }
   else
   if(digitalRead(Button1) == LOW) {
    delay(100);
}
   
   if(digitalRead(Button2) == HIGH){
  Serial.println("Button2:");
  delay(100);
   }
   else
   if(digitalRead(Button2) == LOW) {
    delay(100);
}
  
   if(digitalRead(Button3) == HIGH){
  Serial.println("Button3:");
  delay(100);
   }
   else
   if(digitalRead(Button3) == LOW) {
    delay(100);
}
   
   if(digitalRead(Button4) == HIGH){
  Serial.println("Button4:");
  delay(100);
   }
   else
   if(digitalRead(Button4) == LOW) {
    delay(100);
}
}

I added a picture of the Serial Monitor because I feel like I'm explaining it badly. Thanks.

Edit: I forgot to mention, I added the digitalRead(xxx) == LOW) to try and fix it but it didn't work.

How are your buttons wired? Do you have a pull-down resistor?

You can make your wiring simple by placing the button between GND and the input and setting the pin mode as INPUT_PULLUP. That way LOW would indicate button pressed and HIGH would indicate button released.

You an also simplify your code by replacing:

  if (digitalRead(UpButton) == HIGH) {
    Serial.println("Up:");
    delay(100);
  }
  else if (digitalRead(UpButton) == LOW) {
    delay(100);
  }

with

  if (digitalRead(UpButton) == HIGH) {
    Serial.println("Up:");
  }
  delay(100);

ToddL1962:
How are your buttons wired? Do you have a pull-down resistor?

Yeah. Each button has a 10k pulldown. They're wired exactly how it shows in the guide. Except I added 4 more buttons.

ToddL1962:
How are your buttons wired? Do you have a pull-down resistor?

Yeah. Each button has a 10k pulldown.

ToddL1962:
You can make your wiring simple by placing the button between GND and the input and setting the pin mode as INPUT_PULLUP. That way LOW would indicate button pressed and HIGH would indicate button released.

You an also simplify your code by replacing:

  if (digitalRead(UpButton) == HIGH) {

Serial.println("Up:");
    delay(100);
  }
  else if (digitalRead(UpButton) == LOW) {
    delay(100);
  }




with



if (digitalRead(UpButton) == HIGH) {
    Serial.println("Up:");

}
  delay(100);

That code is what it was before I added the LOW part. It was doing the same thing before I added it.

I'm not familiar with the INPUT_PULLUP. Do you have an example or something on how I could do that? I'm gonna check it out.