controlling servo problem

Hi,
im new in arduino and im trying to control two servo with arduino and adafruit electronics motor shield V1.0. Im using extra 12 V power from adapter and 5V from computer.
my servos are acting strange. (Tower pro MG996R)
For a basic motion i use this code;

#include <Servo.h>
#include <AFMotor.h>
#include <Stepper.h>
Servo myservo;
Servo myservo2;

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println(“Stepper test!”);
digitalRead(A0);
digitalRead(A1);
digitalRead(A2);
digitalRead(A3);
myservo.attach(9);
myservo2.attach(10);
}

void loop() {

myservo.write(180);
delay(50);
myservo.detach( );
myservo.write(70);
delay(50);
myservo.detach( );

myservo2.write(120);
delay(50);
myservo2.detach( );
myservo2.write(60);
delay(50);

}
with this code, myservo2 is running properly. But other servo is not working at all.
Also i do it with buttons. they are working independently from buttons. When im not pushing the buttons, one servo is turning four times, making ticking noise and after a while, it is starting to do same process again. And other servo is not working again. Buttons are not changing anything.
i defined buttons and my void loop is shown below:
void loop() {

if (digitalRead(A0)==1) {
myservo.write(0);
}
else if (digitalRead(A1)==1) {
myservo2.write(0);

}
}
Besides all these, i have very strange reaction from my arduino. When servo is running, the usb driver is connecting and disconnecting ( the usb driver sound is coming from computer repeatedly) I dont know why.

i will be very grateful if someone help me. thanks

does the power supply have a common connected to the arduino.

you have a lot of delay(50);

and Stepper.h? if you not using steppers remove it

post your full code in code tags

have you tried the arduino examples

this is a servo control with buttons I did its a bit ruff but it works one button for cw the other button for ccw

#include <Servo.h> 
//#include <SoftwareServo.h>

Servo myservo;

const int inputPin0 = 0;
int pos = 45;
const int inputPin2 = 2;
const int inputPin3 = 3;
int val1 = 5;
int val2 = 105;

void setup() 
{ 
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);

  myservo.attach(9);
  myservo.writeMicroseconds(1500);  // set servo to mid-point

} 

void loop()
{
  if (digitalRead(inputPin2))
    if (pos > 5)
      pos -= 1;

  if (digitalRead(inputPin3))
    if (pos < 110)
      pos += 1;

  myservo.write(pos);

  // read the input pin:
  int inputPin2 = digitalRead(pos);

  // print out the state of the button:
  // Serial.println(pos);
  // Serial.print(" angle; ");

  delay(analogRead(inputPin0)); // delay up to approx. 1 second based on reading from analog input

}

and adafruit electronics motor shield V1.0.

Does this shield use the servo.h library, or something different?