2018年度用翼端mbedプログラム

Dependencies:   Control_Yokutan_CANver1 XBusServo mbed mbed-rtos

Fork of ControlYokutan2017_2 by albatross

Branch:
mpu????????
Revision:
58:f84bd22fd586
Parent:
57:d7b709dd1c4f
Child:
59:f007e543f8c9
--- a/main.cpp	Sat May 13 15:20:02 2017 +0000
+++ b/main.cpp	Tue Jun 06 13:26:03 2017 +0000
@@ -20,14 +20,14 @@
 #define ERURON_MOVE_DEG_INI_R 18.0        //degree
 #define DRUG_MOVE_DEG_INI_R 0.49
 #define ERURON_TRIM_INI_R 0.38  //値lowerすると頭上げ
-#define DRUG_TRIM_INI_R 0.37
+#define DRUG_TRIM_INI_R  0.37
 
 #define ERURON_MOVE_DEG_INI_L -19.4     //degree
 #define DRUG_MOVE_DEG_INI_L -0.44
-#define ERURON_TRIM_INI_L 0.402  // 値をお大きいくすると頭上げ
-#define DRUG_TRIM_INI_L 0.68//値を小さくすると開く側
+#define ERURON_TRIM_INI_L  0.402  // 値をお大きいくすると頭上げ
+#define DRUG_TRIM_INI_L    0.73//値を小さくすると開く側
 
-#define PHASE_NUM 15 //奇数にしてください。そしてメインコードと必ず同じ値にしてください
+#define PHASE_NUM 7 //奇数にしてください。そしてメインコードと必ず同じ値にしてください
 #define NEUTRAL_PHASE (PHASE_NUM + 1) / 2.0
 
 /*ドラッグラダー
@@ -279,7 +279,7 @@
 {
     drugServo.pulsewidth(calcPulse(drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2]));
     eruronServo.pulsewidth(calcPulse( eruronTrim + eruronMoveDeg * (eruronint - NEUTRAL_PHASE)/(PHASE_NUM-NEUTRAL_PHASE)));
-    pc.printf("WriteNum:%f      ",calcPulse( eruronTrim + eruronMoveDeg * (1.0/PHASE_NUM) * eruronint));
+    pc.printf("WriteNum:%f    ef:%d  ",calcPulse( eruronTrim + eruronMoveDeg * (1.0/PHASE_NUM) * eruronint),eruronint);
     pc.printf("drValue::%f   ei::%f\n\r",drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2],eruronTrim + eruronMoveDeg * (1.0/PHASE_NUM) * (eruronint - NEUTRAL_PHASE));
     //  pc.printf("raw:%f    sampled:%f\n\r",eruronfloat /3.0,SampleFloat(eruronfloat / 3.0));
 }