int i;
int durasi=500;
void setup(){
  for (i=10;i<=13;i++){
    pinMode(i, OUTPUT);
  }
  pinMode(2, INPUT);
  digitalWrite(2, HIGH);
}
void loop(){
  if(digitalRead(2)==LOW){
    for (i=13;i>=10;i--){
      digitalWrite(i, HIGH);
      delay(durasi);
    }
    for (i=10;i<=13;i++){
      digitalWrite(i, LOW);
      delay(durasi);
    }
  }else{
    for (i=10;i<=13;i++){
      digitalWrite(i, HIGH);
      delay(durasi);
    }
    for (i=13;i>=10;i--){
      digitalWrite(i, LOW);
      delay(durasi);
    }
  }
}