File/Sketch Name: SoundDirectionFinder
Version No.: v1.0 Created 14 August, 2019
Original Author: Clyde A. Lettsome, PhD, PE, MEM
Description: This code/sketch makes finding the general direction of sound easy. This code/sketch drives to LEDs to indicate which of two microphones is receiving an audible sound.
If both microphone sensors detect sound both (left and right) LEDs light indicating that both microphones have detected sound. If one microphone sensor (left or right) detects sound,
then the corresponding LED (left or right) will light up. If both microphone sensors detect sound then both LEDs will light up.
License: This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) version 3, or any later
version of your choice, as published by the Free Software Foundation.
Notes: Copyright (c) 2019 by C. A. Lettsome Services, LLC
For more information visit https://clydelettsome.com/blog/2019/08/15/my-weekend-project-sound-direction-tester/
boolean rightVal = 0;
boolean leftVal = 0;
void loop ()
// when the sensor detects a signal above the threshold value, LED flashes
if (leftVal==LOW && rightVal==LOW)
else if (leftVal==LOW && rightVal==HIGH)
else if (leftVal==HIGH && rightVal==LOW)