shorten code by removing unnecessary "actual"
authorozzloy <ozzloy+launchpad_net@gmail.com>
Tue, 14 May 2019 06:52:43 +0000 (23:52 -0700)
committerozzloy <ozzloy+launchpad_net@gmail.com>
Tue, 14 May 2019 06:52:43 +0000 (23:52 -0700)
Change-Id: I6f2e4b69eb335451344e4197ad6e3d982f6c2715

build-stages/i_chooser/i_chooser.ino

index 93d05ff..db6720f 100644 (file)
@@ -198,18 +198,18 @@ void follow() {
   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);
+  unsigned int left_ping_time = ping(left_trigger_pin, left_echo_pin);
+  unsigned int right_ping_time = ping(right_trigger_pin, right_echo_pin);
 
-  left_speed = actual_left_ping_time - desired_left_ping_time;
-  right_speed = actual_right_ping_time - desired_right_ping_time;
+  left_speed = left_ping_time - desired_left_ping_time;
+  right_speed = right_ping_time - desired_right_ping_time;
 
   Serial.print(", left: ping = ");
-  Serial.print(actual_left_ping_time);
+  Serial.print(left_ping_time);
   Serial.print(" speed = ");
   Serial.print(left_speed);
   Serial.print(" right: ping = ");
-  Serial.print(actual_right_ping_time);
+  Serial.print(right_ping_time);
   Serial.print(" speed = ");
   Serial.print(right_speed);
 
@@ -256,7 +256,3 @@ void loop() {
   prior_button_state = button_state;
 
   Serial.println(); }
-
-void loop_asdf() {
-  go(250, 250);
-}