Page 1 of 1

what are the values of the microphone

Posted: Wed Mar 06, 2013 8:32 pm
by tiger30
Hello ,
I'm programming my buggy so that it would stop when I clap , the problem is that I don't have the buggy now and can only use it for a small period of time for the project
my question is is the microphone reading 0 when there is no voice and 255 when there is voice ? or is it like the distance sensor 255 is for far objects while 0 is for close ones ?

Another question is how can I produce a sound when turning , I know that If i need to produce a sound I need to use a loop in that case it will keep producing the sound but wont turn . So does any one has a solution for this ? I attached a pic for this part

Re: what are the values of the microphone

Posted: Fri Mar 08, 2013 1:16 pm
by Benj
Hello,

The microphone is like the distance sensor, the louder the sound the higher the reading will be. You could probably set a threshold value and then tweak the value once you have access to the hardware.

Producing a sound while turning is tricky. Either make the sound very short and inter call the move and play note macros. Or you may be able to use a timer interrupt to generate the sound while the main program moves the robot.