int p1=13;
int p2=3;
int p3=11;
void setup() {
  // put your setup code here, to run once:
   pinMode(p1, OUTPUT);
   pinMode(p2, INPUT);
   pinMode(p3, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
   if(digitalRead(p2)==0){
    digitalWrite(p1, LOW);
    digitalWrite(p3,HIGH);
    delay(500);
   }
   else{
    digitalWrite(p1,HIGH);
    digitalWrite(p3, LOW);
   }
}