X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=phase3%2Fphase3.ino;h=c660c6ec677eec0aed8c7a4e7287c6fcdb30f683;hb=5f85faf55b7352f3f8b6ce96af858c79436cb468;hp=53561100805ddbc1b3703a62cde96f794b0e50a3;hpb=f29767e85688a35398c0989f84d68b9bdfd05d0d;p=challenge-bot diff --git a/phase3/phase3.ino b/phase3/phase3.ino index 5356110..c660c6e 100644 --- a/phase3/phase3.ino +++ b/phase3/phase3.ino @@ -12,8 +12,8 @@ You should have received a copy of the GNU Affero General Public License along with this program. If not, see . */ -// This program implements table top challenge level 1 -- -// The robot stays on the table without falling off. +// 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; @@ -55,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: @@ -89,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: @@ -149,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; } @@ -182,5 +183,5 @@ void loop() { } // Set the motor speeds: - motorsRun(left_speed, right_speed, 0); + motors_run(left_speed, right_speed, 0); }