ft. button press reset

Dependencies:   mbed

Fork of BeaconDemo_RobotCodeNew by James O'Keeffe

Files at this revision

API Documentation at this revision

Comitter:
jhok500
Date:
Mon Mar 13 11:28:57 2017 +0000
Parent:
23:fd0f0931768a
Commit message:
11:28 13/03

Changed in this revision

programs.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/programs.cpp	Mon Mar 13 10:07:07 2017 +0000
+++ b/programs.cpp	Mon Mar 13 11:28:57 2017 +0000
@@ -480,7 +480,7 @@
     // Store the robot group: even robots (0) are green, odd robots (1) are red
     char group = robot_id % 2;
 
-    if(program_run_init == 1) {
+    //if(program_run_init == 1) {
         // Setup the LEDs based on robot_id
         if(group == 0) {
             set_leds(0xFF,0x00);
@@ -489,9 +489,9 @@
             set_leds(0x00,0xFF);
             set_center_led(1,1);
         }
-        program_run_init = 0;
+        //program_run_init = 0;
         random_walk_bearing = rand() % 360;
-    }
+    //}
 
     // When step_cycle = 0 we calculate a vector to move to and a target distance
     if(step_cycle == 0) {
@@ -673,8 +673,8 @@
             right_motor_speed -= 0.75;
         }
         
-        set_left_motor_speed(left_motor_speed);
-        set_right_motor_speed(right_motor_speed);
+        set_left_motor_speed(left_motor_speed/2);
+        set_right_motor_speed(right_motor_speed/2);
         
         // Return early - obstacle avoidance is the top priority
         return;
@@ -735,8 +735,8 @@
             }
         }
         
-        set_left_motor_speed(left_motor_speed);
-        set_right_motor_speed(right_motor_speed);
+        set_left_motor_speed(left_motor_speed/2);
+        set_right_motor_speed(right_motor_speed/2);
     }
     else // role == hunted
     {
@@ -760,8 +760,8 @@
             }
         }
         
-        set_left_motor_speed(left_motor_speed);
-        set_right_motor_speed(right_motor_speed);
+        set_left_motor_speed(left_motor_speed/2);
+        set_right_motor_speed(right_motor_speed/2);
     }
 }