Group 9 BioRobotics / Mbed 2 deprecated the_code

Dependencies:   HIDScope Servo mbed QEI biquadFilter

Revision:
31:969635fd7f57
Parent:
30:ec9e7116f1b0
Child:
32:fad4b119dce0
--- a/THE.cpp	Fri Nov 02 10:27:26 2018 +0000
+++ b/THE.cpp	Fri Nov 02 10:43:27 2018 +0000
@@ -792,36 +792,49 @@
     while(true)
     {
         demo_control(-pi/4.0,-pi/4.0);
-        if ((Counts1(counts1) > -26267-1000 )&& (Counts1(counts1) < -26267+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) < 13369+1000))
+        if ((Counts2(counts2) > -26267-1000 )&& (Counts2(counts2) < -26267+1000))
         {
-            translation_stop();
+            
             rotation_stop();
-            break;
-            }
+            
+        }
+        if ((Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000))
+        {translation_stop();}
+        if ((Counts2(counts2) > -26267-1000 )&& (Counts2(counts2) < -26267+1000)&& (Counts1(counts1) > 13369-1000)&& (Counts1(counts1) < 13369+1000))
+        {break;}
         }
         
     while(true)
     {
         demo_control(pi,pi);
-        if ((Counts1(counts1) > -78802-1000 )&& (Counts1(counts1) < -78802+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) <  13369+1000))
+        if ((Counts2(counts2) > -78802-1000 )&& (Counts2(counts2) < -78802+1000))
         {
-            translation_stop();
+            
             rotation_stop();
-            break;
-            }
+        }
+        if ((Counts1(counts1) > 13369-1000)&& (Counts1(counts1) <  13369+1000))
+            {translation_stop();
         }
+        if ((Counts2(counts2) > -78802-1000 )&& (Counts2(counts2) < -78802+1000) && (Counts1(counts1) > 13369-1000)&& (Counts1(counts1) <  13369+1000))
+        { break;
+        }
+    }
         
     while(true)
     {
         demo_control(pi/4.0,pi/4.0);
-        if ((Counts1(counts1) > -105069-1000 )&& (Counts1(counts1) < -105069+1000)&& (Counts2(counts2) > 24732-1000)&& (Counts2(counts2) < 24732+1000))
+        if ((Counts2(counts2) > -105069-1000 )&& (Counts2(counts2) < -105069+1000))
         {
-            translation_stop();
+            
             rotation_stop();
-            break;
+            
             }
-        }
+        if ((Counts1(counts1) > 24732-1000)&& (Counts1(counts1) < 24732+1000))
+        {translation_stop();}
+        if ((Counts2(counts2) > -105069-1000 )&& (Counts2(counts2) < -105069+1000)&& (Counts1(counts1) > 24732-1000)&& (Counts1(counts1) < 24732+1000))
+        {break;}
     }
+}
 
 
 // FAILURE