Please Help Controlling 2+ servos independently

Hello All
Im using a modified 'Knob' sketch to control a GWS125 Winch Servo (A Servo with 1.5 Turns)
I need to control 2-3 of these servos off one UNO board. Can i just duplicate the code underneath, changing the analouge i/p and PWM o/p pin numbers or is there a more efficient shorter way of doing this? I have tried a few things but don't want to get stuck in the wrong direction as time is of the essence. Any help appreciated !

#include <Servo.h>

Servo myservo; // create servo object to control a servo

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}

void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 1000, 1900); // scale it to use it with the servo (value between 0 and 270) - (map values are arbitrary at the moment)
myservo.writeMicroseconds(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

With a 15ms delay in there "quicker" doesn't really come into it, so just repeat the code (but only put in one delay!)

i tired duplicating the code with 2 servos plugged in and they just seem to jitter about randomly - is my code wrong?

#include <Servo.h>

Servo myservo; // create servo object to control a servo
Servo myservo2;

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
int potpin2 = 1; // analog pin used to connect the potentiometer
int val2;

void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object

myservo2.attach(10); // attaches the servo on pin 9 to the servo object

}

void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 1000, 1900); // scale it to use it with the servo (value between 0 and 180)
myservo.writeMicroseconds(val); // sets the servo position according to the scaled value
// waits for the servo to get there
val2 = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val2 = map(val, 0, 1023, 1000, 1900); // scale it to use it with the servo (value between 0 and 180)
myservo2.writeMicroseconds(val); // sets the servo position according to the scaled value
delay(15); // waits for the servo to get there
}

and they just seem to jitter about randomly

Did you connect both grounds?
How are you powering them?

Reading the same pot pin - is that what you intended?
I don't suppose the reading will have changed much between reads.

 val2 = analogRead(potpin2); 
  val2 = map(val2, 0, 1023, 1000, 1900);  
myservo2.writeMicroseconds(val2);

perhaps?
(please use the # icon on the edito'r toolbar when posting code)

You've got to change "val" to "val2" & "potpin" to "potpin2" to in the code for servo 2

I have now gone back to controlling one servo with the writeMicroseconds() function, tested both servos they are fine. grounds were connected but could have been shoddy i guess .
i was using a bench supply into the breadboard at 5v, this has worked no trouble before with the single servo.
As im writing this I have now altered the code slightly, and am now using the 5v supply that comes on the UNO chip, 2 pots, 2 servos, just tidied it up a bit so i can see whats going on, the potentiometer in analoge pin A0 is controlling the identical movement of both of the servos - i have another pot plugged into pin A1 . PWM should be pin 9 is controlled by A0 and PWM pin 10 Should be controlled by A1. asi said this is at the moment still being powered by the internal power supply.
Here is the code
Ta

#include <Servo.h> 
 
Servo myservo1;  // create servo object to control a servo 
Servo myservo2; 

int potpin = 0;  // analog pin used to connect the potentiometer
int val1;    // variable to read the value from the analog pin 
int potpin2 = 1;  // analog pin used to connect the potentiometer
int val2;

 


void setup() 
{ 
  myservo1.attach(9);  // attaches the servo on pin 9 to the servo object 
  
  myservo2.attach(10);  // attaches the servo on pin 9 to the servo object 

} 
 
void loop() 
{ 
  val1 = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  val1 = map(val1, 0, 1023, 1000, 1900);     // scale it to use it with the servo (value between 0 and 180) 
  myservo1.writeMicroseconds(val1);                  // sets the servo position according to the scaled value 
                             // waits for the servo to get there 
  val2 = analogRead(potpin);            // reads the value of the potentiometer (value between 0 and 1023) 
  val2 = map(val2, 0, 1023, 1000, 1900);     // scale it to use it with the servo (value between 0 and 180) 
  myservo2.writeMicroseconds(val2);                  // sets the servo position according to the scaled value 
  delay(15);                           // waits for the servo to get there 
}

JesperKonge:
You've got to change "val" to "val2" & "potpin" to "potpin2" to in the code for servo 2

thankyou that is working now - im going to try using the external power supply now