MEGACARAZ / Mbed 2 deprecated PID

Dependencies:   btbee m3pi_ng mbed FatFileSystemCpp

Revision:
17:b9608f93ea06
Parent:
16:b09cc5b75049
Child:
18:1dc7fdc248aa
--- a/USBTest.cpp	Fri May 29 13:35:35 2015 +0000
+++ b/USBTest.cpp	Fri May 29 13:40:56 2015 +0000
@@ -218,9 +218,7 @@
                 
                 break;
                 }
-            }
-                
-        
+            }    
         }
         
         ZeTimes[0]= stuff;
@@ -233,8 +231,9 @@
         timer = LoopTime.read();
         
         if(timer < 0.005) {
-        wait(0.005 - timer);
+            wait(0.005 - timer);
         }
+    
     timer = 0;
     LoopTime.reset();
         
@@ -250,51 +249,40 @@
         btbee.printf("\n");
         btbee.printf("Printing to USB");
         
-   WriteTime.start();
-        
-            DIR *d;
-    struct dirent *p;
-   
-    d = opendir("/" FSNAME);
-    
-    FILE *fp = fopen( "/" FSNAME "/Genau.txt", "w"); //file name
-    if ( fp == NULL )
-    {
-        m3pi.leds(1);
-    }
-    
-    for(int i = 0; i < 10; i++) {
+        WriteTime.start();
         
-        for( int j = 0; j < 2; j++)  {
-            
-            junk = Data[i][j];
-            
-            fprintf(fp,"%f        ", junk);
-            
+        DIR *d;
+        struct dirent *p;
+        d = opendir("/" FSNAME);
+        FILE *fp = fopen( "/" FSNAME "/Genau.txt", "w"); //file name
+        if ( fp == NULL ){
+            m3pi.leds(1);
             }
-            
-        fprintf(fp,"\r\n");
-        
-        }
     
-    m3pi.cls();
-   TimeToWrite = WriteTime.read();
-   btbee.printf("%f    \n", TimeToWrite);
-   WriteTime.reset();
+        for(int i = 0; i < 10; i++) {
+            for( int j = 0; j < 2; j++) {
+                junk = Data[i][j];
+                fprintf(fp,"%f        ", junk);
+                }
+            fprintf(fp,"\r\n");
+            }
+        m3pi.cls();
+        TimeToWrite = WriteTime.read();
+        btbee.printf("%f    \n", TimeToWrite);
+        WriteTime.reset();
     
-    btbee.printf("Printed");
-    m3pi.cls();
-    m3pi.printf("Printed");
+        btbee.printf("Printed");
+        m3pi.cls();
+        m3pi.printf("Printed");
     
-    fclose(fp);
-        
+        fclose(fp);
         
         exit(1);
-        }
+    }
 
 
 
-    }
+}
     
 }