MPUとHMCでうごくかもver

Dependencies:   ConfigFile SDFileSystem mbed

Fork of LAURUS_program by hiroya taura

Files at this revision

API Documentation at this revision

Comitter:
YusukeWakuta
Date:
Wed Dec 23 09:59:35 2015 +0000
Parent:
38:ada39f1c6c76
Child:
40:4188d55e62fc
Commit message:
vector????????

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Sat Dec 19 13:50:53 2015 +0000
+++ b/main.cpp	Wed Dec 23 09:59:35 2015 +0000
@@ -54,6 +54,8 @@
 int     UTC_t = 0;              // UTC時刻
 int     pre_UTC_t = 0;          // 前のUTC時刻
 int     ss = 0;                 // 時刻の秒数の小数部分
+int     boolcheck;              //check INT_frag ,true or false
+
 
 Vector  b_f(3);                 // 機体座標に固定された、機体前方向きのベクトル(x軸)
 Vector  b_u(3);                 // 機体座標に固定された、機体上方向きのベクトル(z軸)
@@ -157,6 +159,13 @@
         /******************************* データ処理 *******************************/
         DataProcessing();
         INT_flag = true;
+        /*//check INT_flag true or false(w)=================
+        if(INT_flag)
+        boolcheck = 1;
+        else if(!INT_flag)
+        boolcheck = 0;
+        pc.printf("%d",boolcheck);
+        //==================================================== */
     }
     /* ------------------------------ ↑↑↑ ここまでメインループ ↑↑↑ ------------------------------ */
 }
@@ -193,7 +202,7 @@
     } else {
         roll = -acos(r_cos) * RAD_TO_DEG;
     }
-
+//↓こんなメンバ関数に二個連続呼び出しみたいな書き方知らん
     p_cos = g.GetPerpCompTo(b_l).Normalize() * b_u;
     p_sin = Cross(g.GetPerpCompTo(b_l).Normalize(), b_u) * b_l;
     if(p_sin > 0.0f) {
@@ -385,7 +394,7 @@
     // センサーの値を更新
     mpu.read();
    // hmc.read();
-   //↓i2cの通信に成功しているかどうかを確認(w)
+   /*//↓i2cの通信に成功しているかどうかを確認(w)
     //===========================================================
 if(mpu.checker_get() == 0){
     pc.printf("SUCCESS!!\n\r");
@@ -394,7 +403,7 @@
     pc.printf("%u\n\r",mpu.data.reg[i]);
     }
     //============================================================
-   
+   */
     for(int i=0; i<3; i++) {
         raw_acc.SetComp(i+1, (float)mpu.data.value.acc[i] * ACC_LSB_TO_G);
         raw_gyro.SetComp(i+1, (float)mpu.data.value.gyro[i] * GYRO_LSB_TO_DEG * DEG_TO_RAD);