Servo detach

hi …
im having trouble on how to stop the servo motor i used SGTOWER 5010 , I modified the servo because its capacity is only 180 degrees but i need it to go a full rotation . now im having trouble making it stop . i used servo.detach but it didnt work. by the way i am controlling the servo with an adroind here is my code please help…

#include <Servo.h>
Servo myservo;
int mspeed(1700);
byte serialA;
void setup(){
  Serial.begin(9600);
  myservo.attach(13);
}
void loop(){
    myservo.detach();
    switch (serialA){
      case 1:
      mspeed = 1700;
      myservo.writeMicroseconds(mspeed);
      delay(5000);
      myservo.detach();
    }
}

void serialEvent(){
  serialA= Serial.read();
  Serial.println(serialA);
}