sd実装,動作確認,カード読めず

Dependencies:   mbed MPU6050_2 HMC5883L_2 SDFileSystem3

Files at this revision

API Documentation at this revision

Comitter:
taknokolat
Date:
Tue Feb 12 13:16:29 2019 +0000
Parent:
12:083662bca47d
Commit message:
a

Changed in this revision

config/falfalla.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/config/falfalla.h	Tue Feb 12 12:56:21 2019 +0000
+++ b/config/falfalla.h	Tue Feb 12 13:16:29 2019 +0000
@@ -4,50 +4,19 @@
 #define SWITCH_CHECK 1400
 #define NUMBER_FALFALLA 2 //何号機かを入れるとそれに応じて#if以下が変わって設定が変わる
 
-static float g_kpELE=2.0;
-static float g_kiELE=0.0;
-static float g_kdELE=0.0;
-static float g_kpRUD=3.0;
-static float g_kiRUD=0.0;
-static float g_kdRUD=0.0;
-static float g_kpAIL=3.0;
-static float g_kiAIL=0.0;
-static float g_kdAIL=0.0;
-
-static float g_rightloopROLL=-17.0;
-static float g_rightloopROLL_approach=-17.0;
-static float g_rightloopPITCH=-6.3;
-static float g_rightloopPITCH_approach = -15.0;
-static float g_leftloopROLL=16.0;
-static float g_leftloopROLL_approach=16.0;
-static float g_leftloopPITCH=-6.0;
-static float g_leftloopPITCH_approach=-13.0;
-static float g_gostraightROLL=2.0;
-static float g_gostraightPITCH=-3.0;
-static float g_takeoffTHR=1.0;
-static float g_loopTHR=0.58;
-
-static float g_rightloopROLLshort=-20.0;
-static float g_rightloopPITCHshort=-7.0;
-static float g_leftloopROLLshort=22.0;
-static float g_leftloopPITCHshort=-6.0;
-
-static float g_glideloopROLL = -5.0;      //rewrite
-static float g_glideloopPITCH = 0.0;
-static float g_autoonPITCH = -3.0;
-
-static int g_rightloopRUD = 1500;
-static int g_rightloopRUD_approach=1500;
-static int g_rightloopshortRUD = 1500;
-static int g_leftloopRUD = 1500;
-static int g_leftloopRUD_approach = 1710;
-static int g_leftloopshortRUD = 1500;
-static int g_glideloopRUD = 1500;
-
-static int g_AIL_L_correctionrightloop = 0;
-static int g_AIL_L_correctionrightloopshort = 0;
-static int g_AIL_L_correctionleftloop = 0;
-static int g_AIL_L_correctionleftloopshort = 0;
+static int Servo_NEUTRAL_R;               //SDcard用宣言
+static int Servo_NEUTRAL_L;
+static int Servo_high_FORWARD_R;
+static int Servo_high_FORWARD_L;
+static int Servo_back_R;
+static int Servo_back_L;
+static int Servo_slow_FORWARD_R;
+static int Servo_slow_FORWARD_L;
+static int Turntable_NEUTRAL;
+static int Matchspeed; //機体角度調整
+static int Focus_NEUTRAL;//カメラ焦点
+static int Camera_deg_A;//カメラ角度調整
+static int Camera_deg_B;
 
 
 #if NUMBER_FALFALLA == 1    //1号機
--- a/main.cpp	Tue Feb 12 12:56:21 2019 +0000
+++ b/main.cpp	Tue Feb 12 13:16:29 2019 +0000
@@ -37,20 +37,6 @@
 #define MAX_FORWARD     8          //はやい_姿勢修正用
 #define MAX_BACK        9
 
-int Servo_NEUTRAL_R;               //SDcard用宣言
-int Servo_NEUTRAL_L;
-int Servo_high_FORWARD_R;
-int Servo_high_FORWARD_L;
-int Servo_back_R;
-int Servo_back_L;
-int Servo_slow_FORWARD_R;
-int Servo_slow_FORWARD_L;
-int Turntable_NEUTRAL;
-int Matchspeed; //機体角度調整
-int Focus_NEUTRAL;//カメラ焦点
-int Camera_deg_A;//カメラ角度調整
-int Camera_deg_B;
-
 void getSF_Serial_jevois();
 void getSF_Serial_pi();
 
@@ -70,7 +56,7 @@
 //sd設定
 int GetParameter(FILE *fp, const char *paramName,char parameter[]);
 
-int SetOptions(int Servo_NEUTRAL_R,int *Servo_NEUTRAL_L,
+int SetOptions(int *Servo_NEUTRAL_R,int *Servo_NEUTRAL_L,
             int *Servo_high_FORWARD_R,int *Servo_high_FORWARD_L,
             int *Servo_slow_FORWARD_R,int *Servo_slow_FORWARD_L,
             int *Turntable_NEUTRAL,int *Matchspeed,int *Focus_NEUTRAL,
@@ -422,12 +408,12 @@
 
 void setup(){
      
-    /*SetOptions(&Servo_NEUTRAL_R, &Servo_NEUTRAL_L,
+    SetOptions(&Servo_NEUTRAL_R, &Servo_NEUTRAL_L,
                &Servo_high_FORWARD_R, &Servo_high_FORWARD_L,
                &Servo_slow_FORWARD_R,&Servo_slow_FORWARD_L,
                &Turntable_NEUTRAL,&Matchspeed,&Focus_NEUTRAL,
                &Camera_deg_A, &Camera_deg_B
-               );*/
+               );
      
     Init_sensors();
     //switch2.rise(ResetTrim);
@@ -684,11 +670,11 @@
     else if(SDerrorcount > 0)  pc.printf("ERROR 2. reading parameter is failed[%d]\r\n",SDerrorcount); 
     
     pc.printf("Servo_NEUTRAL_R = %d, Servo_NEUTRAL_L = %d\r\n", *Servo_NEUTRAL_R, *Servo_NEUTRAL_L);
-    pc.printf("Servo_high_FORWARD_R = %d, Servo_high_FORWARD_L = %d, kdRUD = %f\r\n", *Servo_high_FORWARD_R, *Servo_high_FORWARD_L);
-    pc.printf("Servo_slow_FORWARD_R = %f, Servo_slow_FORWARD_L = %f\r\n", *Servo_slow_FORWARD_R, *Servo_slow_FORWARD_L);
-    pc.printf("Turntable_NEUTRAL = %f, Matchspeed =  %f\r\n", *Turntable_NEUTRAL, *Matchspeed);
-    pc.printf("Focus_NEUTRAL = %fr\n", *Focus_NEUTRAL);
-    pc.printf("Camera_deg_A = %f, Camera_deg_B =  %f\r\n", *Camera_deg_A, *Camera_deg_B);
+    pc.printf("Servo_high_FORWARD_R = %d, Servo_high_FORWARD_L = %d\r\n", *Servo_high_FORWARD_R, *Servo_high_FORWARD_L);
+    pc.printf("Servo_slow_FORWARD_R = %d, Servo_slow_FORWARD_L = %d\r\n", *Servo_slow_FORWARD_R, *Servo_slow_FORWARD_L);
+    pc.printf("Turntable_NEUTRAL = %d, Matchspeed =  %d\r\n", *Turntable_NEUTRAL, *Matchspeed);
+    pc.printf("Focus_NEUTRAL = %d\r\n", *Focus_NEUTRAL);
+    pc.printf("Camera_deg_A = %d, Camera_deg_B =  %d\r\n", *Camera_deg_A, *Camera_deg_B);
     
     return SDerrorcount;
 }