Group 9 BioRobotics / Mbed 2 deprecated the_code

Dependencies:   HIDScope Servo mbed QEI biquadFilter

Revision:
29:344d11928bf5
Parent:
28:1481896462ee
Child:
30:ec9e7116f1b0
--- a/THE.cpp	Fri Nov 02 10:03:01 2018 +0000
+++ b/THE.cpp	Fri Nov 02 10:13:57 2018 +0000
@@ -786,39 +786,44 @@
     pwmpin_2 = fabs (pwm1);
     } 
 
+// DEMO
+// Executing demo mode, drawing a square
 void demo_mode()
 {
-    
-    
-    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)){
-        translation_stop()
-        rotation_stop()
-        break;
+    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))
+        {
+            translation_stop();
+            rotation_stop();
+            break;
+            }
+        }
+        
+    while(true)
+    {
+        demo_control(pi,pi);
+        if ((Counts1(counts1) > -78802-1000 )&& (Counts1(counts1) < -78802+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) <  13369+1000))
+        {
+            translation_stop();
+            rotation_stop();
+            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))
+        {
+            translation_stop();
+            rotation_stop();
+            break;
+            }
         }
     }
-        
-    while(true){
-    demo_control(pi,pi);
-    if ((Counts1(counts1) > -78802-1000 )&& (Counts1(counts1) < -78802+1000)&& (Counts2(counts2) > 13369-1000)&& (Counts2(counts2) <  13369+1000)){
-        translation_stop()
-        rotation_stop()
-        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)){
-        translation_stop()
-        rotation_stop()
-        break;
-        }
-    }
-}
-    // code here
-    }
+
 
 // FAILURE
 // To shut down the robot after an error etc 
@@ -998,7 +1003,7 @@
             {
                 CurrentState = WAIT;
                 pc.printf("\r\nState is WAIT\r\n");
-                Statechanged = false;
+                StateChanged = false;
                 }
                 
             break;