mbed microphone sound localization

i

I don’t know anything about this mbed stuff, but I am pretty sure this c-code (I assume) will not compile. You have 2 undeclared variable names in the 2nd and 4th pc.printf statements. The last variable name I will not repeat for fear of invoking the forum’s language censor.

Other than that, it is obvious that you get different values than the threshold, as you measure the soundlevel twice per sending a report on the serial port. (ignoring the fact that you commented sections out so it doesn’t really compile that way) First to measure IF the threshold level is crossed, then again in the pc.printf statement to report WHAT it was. But it isn’t the same soundpulse as before. Usually in a messy physics world no 2 pulses are a alike. It would have worked better had you stored the initial soundlevel in a variable and used that to work with further.

sorry it was suppose to be “lefttime” and “righttime” in the pc.printf. Can someone please enlighten me further.thank you