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
what are the values of the microphone
Moderator: Benj
what are the values of the microphone
- Attachments
-
- 06-03-2013 19-31-29.png
- (9.5 KiB) Downloaded 5250 times
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: what are the values of the microphone
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel