How to run my buzzer for few more seconds after switching off This is a basic level lazer alarm project. When anyone crosed or kept their hands on the lazer. buzzer starts working but when they took their hand from lazer light buzzer stops. But i want even after taking hands my buzzer should work for few (15-30) seconds .so please help me by giving idea..
If you are using a digital buzzer, you can do:
digitalWrite(buzzerPin,HIGH); 
delay(1000);
digitalWrite(buzzerPin,LOW);