X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=build-stages%2Fc_both_sonars%2Fc_both_sonars.ino;h=e39c0c4c20e3e2cc06ad3bc7dec6446452a7d4a8;hb=661ac21e0bd2e7a48c7bed6332e948873f4a2b23;hp=931e1b16f0310c8e30ef9a311e91eed5749d0697;hpb=35ffc3435298c78927cd70d765d6291f16325e5d;p=challenge-bot diff --git a/build-stages/c_both_sonars/c_both_sonars.ino b/build-stages/c_both_sonars/c_both_sonars.ino index 931e1b1..e39c0c4 100644 --- a/build-stages/c_both_sonars/c_both_sonars.ino +++ b/build-stages/c_both_sonars/c_both_sonars.ino @@ -12,10 +12,14 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ +// 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);