Arduino Nano , HC05 bluetooth connection

Hi ,I am making a project with arduino nano. I added 12 button on breadboard and HC05 bluetooth. And I wrote a phone in MIT App Inventer. I added 12 pictures fron 1 to 12 . My goal is want to see number pictures that which button I clicked . It doesnt works completely. Example when I click button 1 , I can see number 1 pictures , after shows number 12 pictures. Bluetooth always sends number 12 signal. when I click another number , show same number after send number 12 signal. It cant send zero signal for stop.

I am new at arduino projects. I am thinking ,It should be setting HC05 . I don't know maybe there is an another problem . I want to help.

void setup() {
 Serial.begin(9600);
 pinMode(2, INPUT_PULLUP);
 pinMode(3, INPUT_PULLUP);
 pinMode(4, INPUT_PULLUP);
 pinMode(5, INPUT_PULLUP);
 pinMode(6, INPUT_PULLUP);
 pinMode(7, INPUT_PULLUP);
 pinMode(8, INPUT_PULLUP);
 pinMode(9, INPUT_PULLUP);
 pinMode(10,INPUT_PULLUP);
 pinMode(11,INPUT_PULLUP);
 pinMode(12,INPUT_PULLUP);
 pinMode(13,INPUT_PULLUP);
  
}
void loop() {
   byte sensorVal1 = digitalRead(2);
   if (sensorVal1 == LOW) 
   {
        Serial.println(1);
        delay(1000);
   }
   byte sensorVal2 = digitalRead(3);
   if (sensorVal2 == LOW) 
   {
        Serial.println(2);
          delay(1000);
   }
   byte sensorVal3 = digitalRead(4);
   if (sensorVal3 == LOW) 
   {
        Serial.println(3);
          delay(1000);
   }
   byte sensorVal4 = digitalRead(5);
   if (sensorVal4 == LOW) 
   {
        Serial.println(4);
          delay(1000);
   }
   byte sensorVal5 = digitalRead(6);
   if (sensorVal5 == LOW) 
   {
        Serial.println(5);
          delay(1000);
   }
   byte sensorVal6 = digitalRead(7);
   if (sensorVal6 == LOW) 
   {
        Serial.println(6);
          delay(1000);
   }
   byte sensorVal7 = digitalRead(8);
   if (sensorVal7 == LOW) 
   {
        Serial.println(7);
          delay(1000);
   }
   byte sensorVal8 = digitalRead(9);
   if (sensorVal8 == LOW) 
   {
        Serial.println(8);
          delay(1000);
   }
   byte sensorVal9 = digitalRead(10);
   if (sensorVal9 == LOW) 
   {
        Serial.println(9);
          delay(1000);
   }
   byte sensorVal10 = digitalRead(11);
   if (sensorVal10 == LOW) 
   {
        Serial.println(10);
          delay(1000);
   }
   byte sensorVal11 = digitalRead(12);
   if (sensorVal11 == LOW) 
   {
        Serial.println(11);
          delay(1000);
   }
    byte sensorVal12 = digitalRead(13);
   if (sensorVal12 == LOW) 
   {
        Serial.println(12);
          delay(1000);
   }

   
    
}

  byte sensorVal12 = digitalRead(13);There is an LED connected to pin 13 that could be affecting the input. Remove this test and see whether the result is better.

Either way replace the repeated code with an array of input pin numbers and a for loop to iterate through them for neater, smaller code.

I tried, I removed d13 from arduino codes , It works good. HC05 doesn't send number 12 signal.And don't send anything (I want to send zero signal). I don't know how to short codes with loops but I will learn.

It works button from 1 to 11.How can I running button 12? Is there any way for that? I saw a project , he used D13 as input.

And thanks for answer UKHeliBob.

   byte sensorVal1 = digitalRead(2);
   byte sensorVal2 = digitalRead(3);

This numbering scheme does not make sense. The name of the variable that contains the state of pin N should have N in the name, NOT some other number.

Your code is littered with delays. It needs NO delays. The state change detection example shows you how to determine that a switch HAS BECOME pressed, as opposed to just knowing that it IS pressed. Send the value when the switch has become pressed, and get rid of the delays.

It works button from 1 to 11.How can I running button 12?

Use one of the analogue pins (A0, A1, A2 etc) as a digital input. Then consider an array of pin numbers. You will be amazed at how much shorter your code will be.