2018年度用翼端mbedプログラム
Dependencies: Control_Yokutan_CANver1 XBusServo mbed mbed-rtos
Fork of ControlYokutan2017_2 by
Diff: main.cpp
- Branch:
- mpu????????
- Revision:
- 64:9d7582920f50
- Parent:
- 63:52b882a5968c
- Child:
- 65:e30d198efe71
--- a/main.cpp Fri Jun 16 12:30:15 2017 +0000 +++ b/main.cpp Wed Jun 28 11:14:34 2017 +0000 @@ -17,14 +17,14 @@ #define MPU_LOOP_TIME 0.01 #define MPU_DELT_MIN 250 -#define ERURON_MOVE_DEG_INI_R 18.0 //degree +#define ERURON_MOVE_DEG_INI_R 14.4//18.0 //degree #define DRUG_MOVE_DEG_INI_R 0.49 -#define ERURON_TRIM_INI_R 0.40 //値lowerすると頭上げ 0.37で後縁一致 +#define ERURON_TRIM_INI_R 0.41733 //値lowerすると頭上げ 0.37で後縁一致 #define DRUG_TRIM_INI_R 0.37 -#define ERURON_MOVE_DEG_INI_L -19.4 //degree +#define ERURON_MOVE_DEG_INI_L -15.52//-19.4 //degree #define DRUG_MOVE_DEG_INI_L -0.52 -#define ERURON_TRIM_INI_L 0.38 // 値を大きくすると頭上げ +#define ERURON_TRIM_INI_L 0.48567 // 値を大きくすると頭上げ #define DRUG_TRIM_INI_L 0.73//値を小さくすると開く側 /*ドラッグラダー @@ -162,6 +162,13 @@ sum = 0; sumCount = 0; } + gyro_c[0]=(char)((int)pitch); + gyro_c[1]=(char)(int)((pitch - (int)pitch)*100); + gyro_c[2]=(char)((int)roll); + gyro_c[3]=(char)(int)((roll - (int)roll)*100); + gyro_c[4]=(char)((int)yaw); + gyro_c[5]=(char)(int)((yaw - (int)yaw)*100); + pc.printf("p:%f,r:%f,y:%f\n\r",pitch,roll,yaw); Thread::wait(1); }//while(1) } @@ -261,7 +268,7 @@ // pc.printf("\n\r"); drugServo.pulsewidth(calcPulse(drugTrim + drugMoveDeg *drugInput)); eruronServo.pulsewidth(calcPulse( eruronTrim + eruronMoveDeg * eruronfloat)); - pc.printf("ef:%10f %5f\n\r",eruronfloat,drugInput); +// pc.printf("ef:%10f %5f\n\r",eruronfloat,drugInput); } void setTrim()