moving two servos with one switch

I have two servos wired up to my bread board one is connected to pin 8 and one to pin 9 i have my code set up but it is only moving one servo can any one see a problem with the code?

#include <Servo.h>
Servo myServo;

int const potPin = A0;
int potVal;
int angle;

void setup() {
myServo.attach(8);

myServo.attach(9);

Serial.begin(9600);

}

void loop() {
potVal = analogRead(potPin);
Serial.print("potval; ");
Serial.print(potVal);
angle = map(potVal, 0 - 900, 1023, 1 - 147, 150);
Serial.print (", angle: ");
Serial.println(angle);

myServo.write(angle);
delay(15);

}

I want both servos to move at the exact same time.

Thanks

Is it the 2nd one that moves?

  myServo.attach(8);
  
  myServo.attach(9);

Add a 2nd one:

Servo myServo;
Servo myServo1;

  myServo1.attach(9);

myServo.write(angle);
myServo.write1(angle);

Yep I just worked it out thanks.

Bit of a novice over here!

http://forum.arduino.cc/index.php?topic=280819.0

I am now getting an error message Expected initialiser before void on the void setup() part of the code

#include <Servo.h>
Servo myServo;
Servo myServos;

int const potPin = A0;
int potVal;
int angle;
int agnles

void setup() {
myServo.attach(8);

myServos.attach(9);

Serial.begin(9600);

}

void loop() {
potVal = analogRead(potPin);
Serial.print("potval; ");
Serial.print(potVal);
angle = map(potVal, 0 - 900, 1023, 1 - 147, 150);
angles = map(potVal, 900 - 0, 1023, 147 - 1, 150);
Serial.print (", angle: ");
Serial.println(angle);

myServo.write(angle);
myServos.write(angles);
delay(15);

}

Please use [ code ] tags.

You forgot a semicolon. When you get an error like that, look at the line before.

This line here is hosed
int agnles - misspelled per later usage:

angles = map(potVal, 900 - 0, 1023, 147 - 1, 150);
myServos.write(angles);

and missing ; at the end as MorganS said.