standardize phase3 more
[challenge-bot] / phase3 / phase3.ino
index 0d94518e85c97612774f3b252e16abff521051eb..c660c6ec677eec0aed8c7a4e7287c6fcdb30f683 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/>.
  */
-// This program implements table top challenge level 1 --
-// The robot stays on the table without falling off.
-
-//  This example code is in the public domain.
+// This program implements table top challenge level ###?### --
+// The robot follows a flat vertical surface at a distance of a couple inches.
 
 // Set *debug* to 1 to enable debugging statements:
 int debug = 1;
@@ -57,7 +55,7 @@ void setup() {
   if (debug) {
     // 115200 is the fastest "standard" baud rate for debugging.
     // Be sure to set the baud Tools=>Serial Monitor to 115200:
-    Serial.begin(115200);
+    Serial.begin(9600);
   }
 
   // Set LED output pin:
@@ -91,7 +89,7 @@ void setup() {
   digitalWrite(right_sonar_trigger, LOW);
 }
 
-void motorsRun(int left, int right, int ms_delay) {
+void motors_run(int left, int right, int ms_delay) {
   // Set left motor direction:
   if (left > 0) {
     // Set left motor to go forward:
@@ -151,8 +149,9 @@ int ping(int sonar_trigger, int sonar_echo, int timeout) {
       // We timed out, so return *timeout*:
       result = timeout;
     }
-  } // else *sonar_echo* is still high from the previous trigger;
-    // return *timeout* when this occurs.
+  }
+  // else *sonar_echo* is still high from the previous trigger;
+  // return *timeout* when this occurs.
   return result;
 }
 
@@ -184,5 +183,5 @@ void loop() {
   }
 
   // Set the motor speeds:
-  motorsRun(left_speed, right_speed, 0);
+  motors_run(left_speed, right_speed, 0);
 }