indicate wire colors in comments
[challenge-bot] / build-stages / c_both_sonars / c_both_sonars.ino
index 931e1b16f0310c8e30ef9a311e91eed5749d0697..e39c0c4c20e3e2cc06ad3bc7dec6446452a7d4a8 100644 (file)
     You should have received a copy of the GNU Affero General Public License
     along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
+// yellow wire
 int right_echo_pin = 6;
+// blue wire
 int right_trigger_pin = 7;
 
+// yellow wire
 int left_echo_pin = 11;
+// blue wire
 int left_trigger_pin = 12;
 
 int count = 0;
@@ -44,11 +48,9 @@ int ping(int trigger, int echo){
   delay(50);
   return ping_time;}
 
-double ping_to_cm(int ping_microseconds)
-{
+double ping_to_cm(int ping_microseconds){
   double sound_cm_per_microsecond_at_sea_level = 0.034029;
-  return ping_microseconds * sound_cm_per_microsecond_at_sea_level / 2;
-}
+  return ping_microseconds * sound_cm_per_microsecond_at_sea_level / 2;}
 
 void setup(){
   Serial.begin(9600);