Push 2 Button simulteneously to produce led as output

Hi, I am a new member here also new to programming and arduino.
Currently, Im on working with my private project which leads to the dead end.

The idea is simple. The project consist of 6 button and 6 led.
Each button when pressed light up each led.

This is the simple part. Then the dead end is when I tried to make Push 2 button simultaneously
will light up certain led. As example,

When push button 1 and 2 simultaneously will light up led 3,4 and 5.

Here I attach my work sample.

int LED1 = 9;
int LED2 = 8;
int LED3 = 7;
int LED4 = 10;
int LED5 = 11;
int LED6 = 12;

int BUTTON1 = 1;
int BUTTON2 = 2;
int BUTTON3 = 3;
int BUTTON4 = 4;
int BUTTON5 = 5;
int BUTTON6 = 6;

void setup(){

pinMode(LED1,OUTPUT);
pinMode(LED2,OUTPUT);
pinMode(LED3,OUTPUT);
pinMode(LED4,OUTPUT);
pinMode(LED5,OUTPUT);
pinMode(LED6,OUTPUT);

pinMode(BUTTON1,INPUT);
pinMode(BUTTON2,INPUT);
pinMode(BUTTON3,INPUT);
pinMode(BUTTON4,INPUT);
pinMode(BUTTON5,INPUT);
pinMode(BUTTON6,INPUT);

digitalWrite(LED1,LOW);
digitalWrite(LED2,LOW);
digitalWrite(LED3,LOW);
digitalWrite(LED4,LOW);
digitalWrite(LED5,LOW);
digitalWrite(LED6,LOW);

}

void loop(){

if(digitalRead(BUTTON1) == HIGH){ // Alphabet "A"
  
  digitalWrite(LED1,1);

}else{

  digitalWrite(LED1,0);
}

if(digitalRead(BUTTON2) == HIGH){ //Alphabet "S"
  digitalWrite(LED2,1);
  digitalWrite(LED3,1);
  digitalWrite(LED4,1);
 
}else{

  digitalWrite(LED2,0);
  digitalWrite(LED3,0);
  digitalWrite(LED4,0);
}

if(digitalRead(BUTTON3) == HIGH){ //Alphabet"D"
  digitalWrite(LED1,1);
  digitalWrite(LED4,1);
  digitalWrite(LED5,1);

}else{

  digitalWrite(LED1,0);
  digitalWrite(LED4,0);
  digitalWrite(LED5,0);
}

if(digitalRead(BUTTON4) == HIGH){ //Alphabet"J"
  digitalWrite(LED2,1);
  digitalWrite(LED4,1);
  digitalWrite(LED5,1);

}else{

  digitalWrite(LED2,0);
  digitalWrite(LED4,0);
  digitalWrite(LED5,0);
}

if(digitalRead(BUTTON5) == HIGH){ //Alphabet "K"
  digitalWrite(LED1,1);
  digitalWrite(LED2,0);
  digitalWrite(LED3,1);

}else{

  digitalWrite(LED1,0);
  digitalWrite(LED2,0);
  digitalWrite(LED3,0);
}

if(digitalRead(BUTTON6) == HIGH){ //Alphabet "L"
  digitalWrite(LED1,1);
  digitalWrite(LED2,1);
  digitalWrite(LED3,1);

}else{

  digitalWrite(LED1,0);
  digitalWrite(LED2,0);
  digitalWrite(LED3,0);
}
if((digitalRead(BUTTON1) == HIGH) && (digitalRead(BUTTON2) == HIGH)){ //Alphabet "B"

digitalWrite(LED1,1);
digitalWrite(LED2,1);
digitalWrite(LED3,0);
digitalWrite(LED4,0);
digitalWrite(LED5,0);
digitalWrite(LED6,0);


}else{

digitalWrite(LED1,0);
digitalWrite(LED2,0);
digitalWrite(LED3,0);
digitalWrite(LED4,0);
digitalWrite(LED5,0);
digitalWrite(LED6,0);
}
if(digitalRead(BUTTON1) == HIGH && (digitalRead(BUTTON3) == HIGH)){ //Alphabet "C"

digitalWrite(LED1,1);
digitalWrite(LED4,1);
digitalWrite(LED3,0);
digitalWrite(LED2,0);
digitalWrite(LED5,0);
digitalWrite(LED6,0);


}else{

digitalWrite(LED1,0);
digitalWrite(LED4,0);
digitalWrite(LED3,0);
digitalWrite(LED2,0);
digitalWrite(LED5,0);
digitalWrite(LED6,0);
}



}

Tried this code and for single push it is working but when push 2 button simultaneously it is no effect.

I need help and advise.
Thank you and much appreciate sir.

Your various if statements are fighting with each other. Let's say you have pressed buttons 1 and 2. Your if for Alphabet "B" will turn on two leds. Immediately afterwards though, you check to see if buttons 1 and 3 are pressed. They're not, so the else clause runs which turns off all the leds before you even notice that they were on.

You need to drop the else clauses and add some code that checks to see if any buttons are pressed. If none are, turn all leds off.

wildbill:
Your various if statements are fighting with each other. Let's say you have pressed buttons 1 and 2. Your if for Alphabet "B" will turn on two leds. Immediately afterwards though, you check to see if buttons 1 and 3 are pressed. They're not, so the else clause runs which turns off all the leds before you even notice that they were on.

You need to drop the else clauses and add some code that checks to see if any buttons are pressed. If none are, turn all leds off.

Sir, im sorry if little bit too much but, can u show preview or sample for the example above?

When push button 1 and 2 simultaneously will light up led 3,4 and 5.

Here is your code that looks for buttons 1 and 2 being pressed at the same time

  if ((digitalRead(BUTTON1) == HIGH) && (digitalRead(BUTTON2) == HIGH)) //Alphabet "B"
  {
    digitalWrite(LED1, 1);
    digitalWrite(LED2, 1);
    digitalWrite(LED3, 0);
    digitalWrite(LED4, 0);
    digitalWrite(LED5, 0);
    digitalWrite(LED6, 0);
  }

The code does not try to turn on LEDS 3,4 and 5, and bear in mind that this code

  if (digitalRead(BUTTON1) == HIGH) // Alphabet "A"
  {
    digitalWrite(LED1, 1);
  }

will also have been executed

How are the inputs wired ?
Do you have pulldown resistors in place to keep the inputs at a known state at all times or are they floating at an unknown (could be HIGH, could be LOW) voltage

Incidentally, it is not a good idea to use pin 1 as a button input as it is used by the Serial interface

UKHeliBob:
Here is your code that looks for buttons 1 and 2 being pressed at the same time

  if ((digitalRead(BUTTON1) == HIGH) && (digitalRead(BUTTON2) == HIGH)) //Alphabet "B"

{
    digitalWrite(LED1, 1);
    digitalWrite(LED2, 1);
    digitalWrite(LED3, 0);
    digitalWrite(LED4, 0);
    digitalWrite(LED5, 0);
    digitalWrite(LED6, 0);
  }



The code does not try to turn on LEDS 3,4 and 5, and bear in mind that this code


if (digitalRead(BUTTON1) == HIGH) // Alphabet "A"
  {
    digitalWrite(LED1, 1);
  }



will also have been executed

How are the inputs wired ?
Do you have pulldown resistors in place to keep the inputs at a known state at all times or are they floating at an unknown (could be HIGH, could be LOW) voltage

Incidentally, it is not a good idea to use pin 1 as a button input as it is used by the Serial interface

UKHeliBob:
Here is your code that looks for buttons 1 and 2 being pressed at the same time

  if ((digitalRead(BUTTON1) == HIGH) && (digitalRead(BUTTON2) == HIGH)) //Alphabet "B"

{
    digitalWrite(LED1, 1);
    digitalWrite(LED2, 1);
    digitalWrite(LED3, 0);
    digitalWrite(LED4, 0);
    digitalWrite(LED5, 0);
    digitalWrite(LED6, 0);
  }



The code does not try to turn on LEDS 3,4 and 5, and bear in mind that this code


if (digitalRead(BUTTON1) == HIGH) // Alphabet "A"
  {
    digitalWrite(LED1, 1);
  }



will also have been executed

How are the inputs wired ?
Do you have pulldown resistors in place to keep the inputs at a known state at all times or are they floating at an unknown (could be HIGH, could be LOW) voltage

Incidentally, it is not a good idea to use pin 1 as a button input as it is used by the Serial interface

yeah bro, all resistor are all in place. for input wire I will attach it later.

for input wire I will attach it later.

I have no idea what that means

UKHeliBob:
I have no idea what that means

Hahah sorry for my bad language..

I mean I will attach the circuit diagram..

Here is the circuit diagram
https://imgur.com/a/ti3jdDp