Clapper projects

Hi.

Im a beginner with arduino and I hope some people can help me with my clapper project.

I want to turn on a relay when i clap 2 times. If i clap more or less than 2 times, nothing will happen. I have figured out how it works with 1 clap, but i dont know how the code for detecting 2 clap are. Do i need to use switch case or what?

thanks for help

Klapp_nyest.ino (1.38 KB)

Please post your code directly as described in "How to use this forum - please read" at the top of every forum.

And you need to specify your requirements a bit more clearly. I think you probably mean clap twice within a limited time, so say how long. And then also say how long you want to wait to check that there isn't going to be another clap making it too many so the relay shouldn't switch on.

Steve