X-Git-Url: http://challenge-bot.com/repos/?p=challenge-bot;a=blobdiff_plain;f=build-stages%2Fg_follow%2Fg_follow.ino;fp=build-stages%2Fg_follow%2Fg_follow.ino;h=344c46e76a67898134e4af8600c11d8930763d57;hp=3c01a4d7cf0c2c3282d927d9f853978b220a8d87;hb=4fb38d0258fc0574273cdcf1000cf2820e3297f6;hpb=648189216b1dbcb52d8b95ec3d674e6f01e46d43 diff --git a/build-stages/g_follow/g_follow.ino b/build-stages/g_follow/g_follow.ino index 3c01a4d..344c46e 100644 --- a/build-stages/g_follow/g_follow.ino +++ b/build-stages/g_follow/g_follow.ino @@ -28,10 +28,6 @@ int left_motor_speed_pin = 10; int left_echo_pin = 11; int left_trigger_pin = 12; -// you'll need to adjust these based on your sonar sensor's behavior -int desired_right_ping_time = 800; -int desired_left_ping_time = 800; - void on(int pin){ digitalWrite(pin, HIGH);} @@ -124,8 +120,9 @@ void loop(){ int left_speed; int right_speed; - int forward_speed = 250; - int stop_speed = 0; + // you'll need to adjust these based on your sonar sensor's behavior + int desired_right_ping_time = 800; + int desired_left_ping_time = 800; unsigned int actual_left_ping_time = ping(left_trigger_pin, left_echo_pin); unsigned int actual_right_ping_time = ping(right_trigger_pin, right_echo_pin);