Unina Corse EL / Mbed 2 deprecated f4_sd_imu_4

Dependencies:   SDFileSystem_conMOD mbed-rtos mbed

Fork of f4_sd_imu_4 by ratto killer

Revision:
4:58e4283f9a59
Parent:
3:3b2b8b0955f9
Child:
5:52d527a45a30
--- a/main.cpp	Wed Nov 22 02:41:36 2017 +0000
+++ b/main.cpp	Wed Nov 22 21:45:19 2017 +0000
@@ -18,12 +18,26 @@
     printf("Goodbye World!\n\r");
     raccoltaDati();*/
     Timer timer;
-    int i=0;
-    timer.start();
     while(1){
+        timer.start();
         raccoltaDati();
-        stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n");
-        if(i%100==99){
+        //stampaFile("A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n");
+        fprintf(fp, "A1xxxxoooooggggggeeeeeeerrrryyyyynhgrgr#2\r\n");
+        timer.stop();
+        if(timer.read_ms()>100){
+                printf("tempo: %f\n\r", timer.read());
+        }
+        else{
+            wait_ms(100-timer.read_ms());
+        }
+        timer.reset();
+        if (mybutton == 0) {
+            chiusuraFile();
+            aperturaFile(); 
+            wait(1); 
+        }
+        
+        /*if(i%100==99){
             timer.stop();
             float tempo = 1 - timer.read();
             wait(tempo);
@@ -31,11 +45,7 @@
             timer.reset();
             timer.start();  
         }
-        i++;
-        if (mybutton == 0) {
-            chiusuraFile();
-            aperturaFile(); 
-            wait(0.5); 
-        }
+        i++;*/
+        
     }
 }