copy paste loop contents

I have a loop that works, It reads a potentiometer, but I want to read 5 in total
I’ve tried copy pasting to get the 2nd pot working but it never does
I think its the curly braces but i’m struggling to figure it out

void loop()
{
//POT1
  p1volts = analogRead(PA0);
  DrawBarChartP1(tft, 10, 100, 130, 5, 0, 4095 , 409, p1volts, 2, 1, GREEN, DKBLUE, BLUE, WHITE, BLACK, "POT1", graph_1);
}
void DrawBarChartP1(Adafruit_ILI9341 & d, double x , double y , double w, double h , double loval , double hival , double inc , double curval ,  int dig , int dec, unsigned int barcolor, unsigned int voidcolor, unsigned int bordercolor, unsigned int textcolor, unsigned int backcolor, String label, boolean & redraw)
{
  double stepval, range;
  double mx, level;
  double i, data;

  if (redraw == true) {
    redraw = false;
    d.drawRect(x , y , w, h, bordercolor);
    stepval =  inc * (double (w) / (double (hival - loval))) - .001;
    for (i = 0; i <= w; i += stepval) {
    }
  }
  level = (w * (((curval - loval) / (hival - loval))));
  d.fillRect(x + level + 1, y + 1, w - level - 2, h - 2,  voidcolor);
  d.fillRect(x + 1, y + 1 , level - 1,  h - 2, barcolor);
}

I can't see any attempt to include more than one pot. Post a complete program showing what you tried.

Steve

Sorry I figured it out just after I posted it

I want to read 5 in total

Rather than using 5 copies of the same code, which it sounds like you are doing, consider using arrays to hold data and iterate through them.