#include <Servo.h>

Servo myservo;

int pos = 0;
const int t = 7;
void setup() {
  myservo.attach(11);
  pinMode(t, INPUT_PULLUP);
}

void loop() {
  if(digitalRead(t)==0){
  for (pos = 0; pos <= 180; pos += 1) {
    myservo.write(pos);
    /*if(digitalRead(t)==0){
      myservo.write(0);
      delay(1000);
    }else{*/
      delay(15);
    }                       
  //}
  for (pos = 180; pos >= 0; pos -= 1) {
    myservo.write(pos);
    delay(15);
  }
}
}