Help please.

I am doing working on a VU meter using the Arduino Uno. I have written a function that will allow me to use the VU meter in barmode and in dotmode.
I want to use analog pin A4 to select between the 2 modes, to do this I will be using a dip switch. My problem is at the void loop.
Thanks for help in advance.

int analogPin = A0;    //The pin that the potentiometer is attached to
int modeSelection = A4;    //Mode selection on analog pin A4.
int ledCount = 10;    //The number of LEDs in the bar graph

int ledPins[] = {3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };   //An array of pin numbers to which LEDs are attached

void setup() {
  // loop over the pin array and set them all to output:
  for (int i = 0; i < ledCount; i++) 
  {
    pinMode(ledPins[i], OUTPUT); 
  }
}


void loop()
{
  modeSelection = analogRead(modeSelection);
  
  if (modeSelection == 0)
  {
    barMode();    //Barmode function recall.
  }
  else
  {
    dotMode();    //Dotmode function recall.
  }
}


///////////Below this line, it works perfectly!!//////////////////


int barMode(void)    //Barmode function.
{
  int sensorReading = analogRead(analogPin);

  int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

  for (int i = 0; i < ledCount; i++) 
  {
    
    if (i < ledLevel) 
    {
      digitalWrite(ledPins[i], HIGH);
    } 
    else {
      digitalWrite(ledPins[i], LOW); 
    }
  }
}



int dotMode(void)    //Dotmode function.
{
  int sensorReading = analogRead(analogPin);

  int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

  for (int i = 0; i < ledCount; i++) 
  {
    
    if (i == ledLevel) 
    {
      digitalWrite(ledPins[i], HIGH);
    } 
    else {
      digitalWrite(ledPins[i], LOW); 
    }
  }
}

My problem is at the void loop

What problem?

I would like to do the following.
If I press the switch, I would like it to execute the barMode(); function.
If it is not pressed in, I would like it to execute the dotMode(); function.

Yes, that’s what the code does.
What is the problem?

Edit: sorry, you mean the overwriting of your input pin number?
Use a different variable, and always make the pin number constant

Thanks for your help.