Midi octapad troubleshooting

I maked midi octapad using arduino mega 2560 board. But there are two pads not working properly. Are there any kindly person, can repair the code for me? Please help me.

#include <MIDI.h>

#include <MIDI.h>
MIDI_CREATE_DEFAULT_INSTANCE();
byte patchNum = 0;

#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int pinRead;
char pinAssignments[8] ={'A0','A1','A2','A3','A4','A5','A6','A7'};
byte PadNote[8] =    { 60,61,62,63,64,65,66,67};         
int PadCutOff[8] =   {300,300,300,300,300,300,300,300};       
int MaxPlayTime[8] = { 40,40,40,40,40,40,40,40};              
#define  midichannel 10;                              
boolean VelocityFlag  = false;                          
boolean activePad[8] = { 0,0,0,0,0,0,0,0 };                  
int PinPlayTime[8] =   { 0,0,0,0,0,0,0,0 };                  
byte status1;
int pin = 0;     
int hitavg = 0;

void setup() {
Serial.begin(31250);  
pinMode(8,INPUT_PULLUP);
pinMode(9,INPUT_PULLUP);
MIDI.begin(MIDI_CHANNEL_OMNI);
lcd.begin(16, 2);
lcd.setCursor(3,0);
lcd.print ("WELL COME");
lcd.setCursor(1,1);
lcd.print ("HARSHA PRODUCT");


delay(3000);
lcd.clear();


lcd.setCursor(0,0);
lcd.print("H DRUM + MIDIPAD");
lcd.setCursor(0,1);
lcd.print("CHANNEL = A  0    ");  

}

void loop(){
  
  
 ///////////////////////////////lcd/////////////////
  for(int pin=0; pin < 8; pin++)                          
  {
    hitavg = analogRead(pinAssignments[pin]);  
    if((hitavg > PadCutOff[pin]))
    {
      if((activePad[pin] == false))
      {
        if(VelocityFlag == true)
        {
          hitavg = (hitavg / 8) -1 ;                                   
        }
        else
        {
          hitavg = 127;
        }
        MIDI_TX(144,PadNote[pin],hitavg); 

        PinPlayTime[pin] = 0;
        activePad[pin] = true;
      }
      else
      {
        PinPlayTime[pin] = PinPlayTime[pin] + 1;
      }
    }
    else if((activePad[pin] == true))
    {
      PinPlayTime[pin] = PinPlayTime[pin] + 1;
      if(PinPlayTime[pin] > MaxPlayTime[pin])
      {
        activePad[pin] = false;
        MIDI_TX(144,PadNote[pin],0); 
      }
    }
  }
      krishantha();
}

// Transmit MIDI Message
void MIDI_TX(byte MESSAGE, byte PITCH, byte VELOCITY) 
{
  status1 = MESSAGE + midichannel;
  Serial.write(status1);
  Serial.write(PITCH);
  Serial.write(VELOCITY);
}
  void krishantha(){
 if (digitalRead(8) == LOW)  {
    patchNum++;
    MIDI.sendProgramChange(patchNum,1);
    delay(200);
  lcd.setCursor(0,1);
  lcd.println("CHANNEL = A+       ");
  lcd.setCursor(13,1);
  lcd.print(patchNum); 
  }
  if (digitalRead(9) == LOW)  {
    patchNum--;
    MIDI.sendProgramChange(patchNum,1);
    delay(200);
  lcd.setCursor(0,1);
  lcd.println("CHANNEL = A-       ");
  lcd.setCursor(13,1);
  lcd.print(patchNum);
  }
  }

harsha_full_display_midi_cord.ino.pdf (31 KB)

More people will see your code if you post it as described in the how to use this forum sticky.

But there are two pads not working properly.

What does "not working" mean?

And which two pads?

Steve

A6 and A7 pads not working.
See throught fl studio software, A0 to A5 pads are send the. But A6 and A7 pads are not send note.

char pinAssignments[8] ={'A0','A1','A2','A3','A4','A5','A6','A7'};

Start with the fact that 2 characters like A0 don't fit in to a char variable. It's not easy to see how any of it is working.

BTW why is MIDI.h included twice?

Steve