201803_oshima Team.F.C.

Dependencies:   BMP180 MPU6050 SDFileSystem mbed

Fork of 201803_oshima_jodan by Haruki Sashida

Revision:
7:852922a4058a
Parent:
6:e9004c78b394
Child:
8:eb1ebae5f051
--- a/main.cpp	Tue Mar 06 07:05:23 2018 +0000
+++ b/main.cpp	Tue Mar 06 07:18:25 2018 +0000
@@ -171,18 +171,21 @@
                 _para(UNLOCK);
                 tf_para = false;
                 timer1.stop();
-                twe.printf("PARA_OPEN\r\n");    
+                twe.printf("PARA_OPEN\r\n");
+                i = 0;    
                 ochiru.attach(_recovery,0.1);   //パラメータ保存のためのやつ
                 
             }
         }
     }
+    
+    if(Cnt_buff == 250) Cnt_buff = 0;
                    
 }
 
 void _recovery(){
     
-    if(Cnt_buff == 0){
+    if(i == 0){
         fp = fopen("/sd/mydir/sdtest.txt", "a");
         if(fp == NULL)twe.printf("ERROR\r\n");
     }
@@ -195,7 +198,7 @@
     fprintf(fp, "%f,%f,%f,%f,%f,%f,%f\r\n",Alt_now,a[0],a[1],a[2],d[0],d[1],d[2]);
     Cnt_buff++;
     
-    if(Cnt_buff == 50){
+    if(i == 50){
         fclose(fp);
         Cnt_buff = 0;
     }