Clapper Project in arduino for Robot

I am making a Complex Robot with Mega. I wish to control the robot with claps like wise
if i make 1 clap then it should trigger an action [eg: Line following] then if i make 2 claps then it should trigger any other action [eg: Obstacle avoider] . So if any one could help me do this very easily .
I need the code only as i am a 9th grader a newbie to arduino.

<<< I NEED IT FAST >>>>>
I HAVE TO DISPLAY IT IN SCIENCE EXIBITION FOR MY SCHOOL AND MINE IS A REALLY SPECIAL PROJECT
SO 2 DAYS LEFT
<<< FAAST >>>>

I NEED THE CODE ONLY
i reffered many sites but notin's helping :fearful: :cry: :cry:

In two days, you want to have a fully functioning robot? This without knowledge on programming?

Me thinks you are in for a mayor disappointment.

You have no information on how you are sensing the claps, or sensing the obstacles etc.

Weedpharma

No i have a sound sensor and ive tried working with is ie. single clap on and off but i dont no double claps.
Moreover ive tested all the sensors by coding myself. I know programming but not to that extent.

HELP ME

All I can suggest is that once you have detected one clap, loop for one second looking for another clap. If not received, proceed as for one clap.

If clap recieved
For count = 0; count less than 100; count++
Look for clap
If clap, exit and process for two claps
Delay 10 mS

No clap so process as one clap.

Weedpharma

Please post replies here:
http://forum.arduino.cc/index.php?topic=281235.msg1974315#msg1974315

Thread locked.