2017.11伊豆大島共同打ち上げ実験のデータ取得&保存用プログラム

Dependencies:   BMP180 MPU6050 SDFileSystem mbed

Fork of SDFileSystem_HelloWorld by mbed official

Revision:
5:1e66d892109b
Parent:
4:4920f8106896
Child:
6:aae92602ef84
--- a/main.cpp	Sun Oct 22 04:37:12 2017 +0000
+++ b/main.cpp	Sun Oct 22 15:07:04 2017 +0000
@@ -28,7 +28,7 @@
 float   _getAlt(float press, float temp);
 float   _DMS2DEG(float raw_data);
 float   _median(float data[], int num);
-//int     _input(char c);
+int     _input(char c);
 
 /*  グローバル変数 */
 float   a[3];
@@ -42,9 +42,6 @@
 int     cnt_gps  = 0;
 int     Log_cnt  = 0;
 int     Phase    = 0;
-bool    Launched = false;
-bool    Opened   = false;
-bool    Leafing  = false;
 
 
 int main() {
@@ -96,7 +93,7 @@
     FILE *lfp = fopen("/local/alt.txt","a");
     fprintf(lfp,"地上高度:%f\r\n",Land_Alt);
     fclose(lfp);
-//    for(int i=0;i<10;i++)pc.printf("%f\n\r",Alt_buff[i]);
+    for(int i=0;i<10;i++)pc.printf("%f\n\r",Alt_buff[i]);
     
     /*  データ取得開始 */
     timer.start();
@@ -106,16 +103,16 @@
         /*  フェーズ管理  */
         if(Phase==0){
             if(oshirase2==1){
-                Phase    = 1;   //上昇フェーズへ移行
+                Phase = 1;  //上昇フェーズへ移行
                 alt_timer.start();
             }
         }else if(Phase==1){
             if(oshirase2==0){
-                Phase = 2;      //降下1フェーズへ移行
+                Phase = 2;  //降下1フェーズへ移行
             }
         }else if(Phase==2){
             if(oshirase2==1){
-                Phase = 3;      //降下2フェーズへ移行
+                Phase = 3;  //降下2フェーズへ移行
             }
         }
 
@@ -177,7 +174,7 @@
         fclose(fp);
         Log_cnt = 0;
     }
-//    pc.printf("%d,%f, %f, %f, %f, %f, %f, %f \r\n",Phase, Time, Temperature, Pressure, Altitude, a[0],a[1],a[2]);
+    pc.printf("%d,%f, %f, %f, %f, %f, %f, %f \r\n",Phase, Time, Temperature, Pressure, Altitude, a[0],a[1],a[2]);
 }
 
 
@@ -219,10 +216,10 @@
 
 int _input(char c){
     if(c!='\0'){
-      // pc.printf("%c\r\n",c);  
+       pc.printf("%c\r\n",c);  
     } 
     if(c=='f'){
-        // pc.printf("flight mode on\r\n");
+         pc.printf("flight mode on\r\n");
         return -1;
     }else if(c=='s'){
         return 1;
@@ -232,4 +229,4 @@
         return 7;
     }
     return 0;
-}
\ No newline at end of file
+}