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

Dependencies:   Control_Yokutan_CANver1 XBusServo mbed mbed-rtos

Fork of ControlYokutan2017_2 by albatross

Branch:
mpu????????
Revision:
47:5e3a836deaba
Parent:
46:c722841055c7
Child:
48:0bd406fa4a7f
--- a/main.cpp	Wed Mar 22 13:47:03 2017 +0000
+++ b/main.cpp	Thu Mar 23 08:50:40 2017 +0000
@@ -8,7 +8,7 @@
 #define TO_SEND_DATAS_NUM 7
 #define INIT_SERVO_PERIOD_MS 20
 #define WAIT_LOOP_TIME 0.02
-#define CONTROL_VALUES_NUM sizeof(int) + 2
+#define CONTROL_VALUES_NUM 7
 #define TO_SEND_CAN_ID 100
 #define SEND_DATAS_LOOP_TIME 0.1
 #define RECEIVE_DATAS_LOOP_TIME 0.1
@@ -17,14 +17,14 @@
 #define MPU_DELT_MIN 250
 
 #define ERURON_MOVE_DEG_INI_R 1.0
-#define DRUG_MOVE_DEG_INI_R 0.5
+#define DRUG_MOVE_DEG_INI_R -0.32
 #define ERURON_TRIM_INI_R 0.35
-#define DRUG_TRIM_INI_R 0.37
+#define DRUG_TRIM_INI_R 0.62
 
 #define ERURON_MOVE_DEG_INI_L 0.8
-#define DRUG_MOVE_DEG_INI_L -0.32
+#define DRUG_MOVE_DEG_INI_L -0.43
 #define ERURON_TRIM_INI_L 0.4
-#define DRUG_TRIM_INI_L 0.62
+#define DRUG_TRIM_INI_L 0.68//値を小さくすると開く側
 
 #define ERURON_MOVE_RANGE 0.24
 
@@ -161,7 +161,7 @@
             pitch *= 180.0f / PI;
             yaw   *= 180.0f / PI;
             roll  *= 180.0f / PI;
-            myled= !myled;
+         //   myled= !myled;
             count = t.read_ms();
             sum = 0;
             sumCount = 0;
@@ -252,7 +252,7 @@
     drugServo.pulsewidth(calcPulse(drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2]));
     eruronServo.pulsewidth(calcPulse( eruronTrim + eruronMoveDeg * ((1.0/PHASE_NUM) * eruronint) * ERURON_MOVE_RANGE));
     pc.printf("WriteNum:%f      ",calcPulse( eruronTrim + eruronMoveDeg * (1.0/PHASE_NUM) * eruronint* ERURON_MOVE_RANGE));
-    pc.printf("drValue::%f   ef::%d\n\r",drugTrim + drugMoveDeg *(float)controlValues[sizeof(float)],eruronint);
+    pc.printf("drValue::%f   ef::%d\n\r",drugTrim + drugMoveDeg *(float)controlValues[sizeof(int) + 2],eruronint);
     //  pc.printf("raw:%f    sampled:%f\n\r",eruronfloat /3.0,SampleFloat(eruronfloat / 3.0));
 }