Arduino UNO controlling six servo using variable resistor not working

hi guys , i made this code to operate six servos using variable resistors but it look like it is not working can you check if there is any problem in the code?

#include <Servo.h>

Servo myservo1; // create servo object to control a servo
Servo myservo2;
Servo myservo3;
Servo myservo4;
Servo myservo5;
Servo myservo6;

int potpin1 = 0; // analog pin used to connect the potentiometer
int potpin2 = 1;
int potpin3 = 2;
int potpin4 = 3;
int potpin5 = 4;
int potpin6 = 5;

int val; // variable to read the value from the analog pin

void setup()
{
myservo1.attach(3); // attaches the servo on pin 9
myservo2.attach(5); // attaches the servo on pin 10
myservo2.attach(6);
myservo2.attach(9);
myservo2.attach(10);
myservo2.attach(11);
}

void loop()
{
val = analogRead(potpin1); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo1.write(val); // sets servo according to the scaled value
val = analogRead(potpin2); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo2.write(val); // sets servo according to the scaled value
val = analogRead(potpin3); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo3.write(val); // sets servo according to the scaled value
val = analogRead(potpin4); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo4.write(val); // sets servo according to the scaled value
val = analogRead(potpin5); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo5.write(val); // sets servo according to the scaled value
val = analogRead(potpin6); // reads the value of the pot
val = map(val, 0, 1023, 0, 179); // scale it between 0 and 180
myservo6.write(val); // sets servo according to the scaled value
delay(15); // waits for the servo to get there
}

Doesn’t seem much wrong with the code that a good dose of array couldn’t fix, but you said “variable resistor”.
That’s not the same as a potentiometer - how have you got the analogue inputs wired?

Can you explain what

but it look like it is not working

means?

#include <Servo.h>

const int servoPins [6] = {3, 5, 6, 9, 10, 11};
const int potPin [6] = {0,1,2,3,4,5};
Servo myservo[6];

void setup()
{
 for (int i = 0; i < 6; ++i) {
   myservo[i].attach(servoPin [i]);
 }
}

//and so on

AWOL:
Doesn’t seem much wrong with the code that a good dose of array couldn’t fix, but you said “variable resistor”.
That’s not the same as a potentiometer - how have you got the analogue inputs wired?

Can you explain what

but it look like it is not working

means?

#include <Servo.h>

const int servoPins [6] = {3, 5, 6, 9, 10, 11};
const int potPin [6] = {0,1,2,3,4,5};
Servo myservo[6];

void setup()
{
for (int i = 0; i < 6; ++i) {
   myservo[i].attach(servoPin [i]);
}
}

//and so on

sorry i meant potentiometer it make any different ?

im testing potentiometer because i want to use Joystick to control robotic arm. im planning to add pololu controller

sorry i meant potentiometer it make any different

Yes - a variable resistor is a two terminal device, whereas a potentiometer is (effectively) two variable resistors, and is a three terminal device, which is why I asked how you had them wired.

I also asked what

but it look like it is not working

means.