I-O DATA DEV2 / Mbed 2 deprecated ud-gs4-R_400G_SD_Log_No1

Dependencies:   mbed SDFileSystem_

Revision:
40:16c2d6b97a92
Parent:
39:75f7b67a5747
Child:
41:43828af3765f
--- a/main.cpp	Fri Sep 10 06:52:10 2021 +0000
+++ b/main.cpp	Fri Sep 10 08:41:05 2021 +0000
@@ -146,8 +146,8 @@
     //平均(/s)
     if (newcount == 500) {
         float asc = (float)as / 500.0f;
-        //pc.printf("avarage(new) x:%2.2f,y:%2.2f,z:%2.2f,scaler=%2.2f,max:%2.2f\r\n",
-            //(float)ax/500.0f*0.005,(float)ay/500.0f*0.005,(float)az/500.0f*0.005,(float)as/500.0f*0.005, (float)tmp_max*0.005);
+        pc.printf("avarage(new) x:%2.2f,y:%2.2f,z:%2.2f,scaler=%2.2f,max:%2.2f\r\n",
+            (float)ax/500.0f*0.005,(float)ay/500.0f*0.005,(float)az/500.0f*0.005,(float)as/500.0f*0.005, (float)tmp_max*0.005);
         sprintf(stracc1,"%d,%d,%2.2f,%2.2f\r\n",timecount,time(NULL),asc*0.005,(float)tmp_max*0.005);
         
         if((strlen(buffer1)+strlen(stracc1)) > DATA_SIZE) {
@@ -254,12 +254,13 @@
             if(!fp1){
                 pc.printf("fp1 create file failed:%d\r\n",errno);
                 NVIC_SystemReset();
-                }
+            }
             fp2 = fopen(filename2,"ab");
             if(!fp2){
                 pc.printf("fp2 create file failed:%d\r\n",errno);
                 NVIC_SystemReset();
             }
+        
             pc.printf("Create New File:%d,%d",timecount,time(NULL));
         }
         
@@ -302,6 +303,9 @@
             pc.printf("fp1(%s) open failed errno:%d\r\n",filename1,errno);
             //NVIC_SystemReset();
         }
+        else{
+            pc.printf("fp1 fopen success\r\n");
+        }
         retry++;
         wait_ms(100);
     }
@@ -312,6 +316,9 @@
             pc.printf("fp2(%s) open failed errno:%d\r\n",filename2,errno);
             //NVIC_SystemReset();
         }
+        else{
+            pc.printf("fp2 fopen success\r\n");
+        }
         retry++;
         wait_ms(100);
     }
@@ -321,7 +328,7 @@
             //pc.printf("readEEPROM:0x%x\r\n",readEEPROMByte(i));
             max_g |=  readEEPROMByte(i) << 8*i;
     }
-    pc.printf("read max_g from eeprom:%d\r\n",max_g);
+    pc.printf("read max_g from eeprom:%2.2f\r\n",(float)max_g*0.005);
 
     while(init) {
         init = initLIS331();