void setup() {
// put your setup code here, to run once:
pinMode(13,OUTPUT);
pinMode(6,INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
int x=digitalRead(6);
if(x==HIGH)
{
tone(13,500);
digitalWrite(13,HIGH);
}
else
{
digitalWrite(13,LOW);
noTone(13);
}
}