// ,passive buzzer play around with d and s
void setup() {
// put your setup code here, to run once:
pinMode(2, OUTPUT);
pinMode(4, INPUT_PULLUP);
}
int tog = 0;
int d = 10;
int s = 1;
int i = 0;
int s1[4] = {300,800,300,800};
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(4)==0){
delay(d*25);
if(tog == 0){
tog = 1;
}else
{
tog =0;
}
}
if(tog == 1){
for(int i=0; i<sizeof(s1)-1; i++){
tone(2,s1[i]);
delay(d);
}
}
}