Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: HCSR04_2 MPU6050_2 mbed SDFileSystem3
Fork of Autoflight2018_58 by
Revision 48:e58f6e6e69eb, committed 2018-09-27
- Comitter:
- taknokolat
- Date:
- Thu Sep 27 17:26:40 2018 +0000
- Parent:
- 47:9e11751aa42c
- Commit message:
- a;
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Sep 27 06:44:49 2018 +0000 +++ b/main.cpp Thu Sep 27 17:26:40 2018 +0000 @@ -1308,7 +1308,7 @@ if(TakeoffCount>5){ //autopwm[THR] = SetTHRinRatio(0.3); - autopwm[THR] = 1180+320*0.3; + autopwm[THR] = 1180+320*2*0.3; targetAngle[PITCH]=g_gostraightPITCH; autopwm[RUD]=trimpwm[RUD]; //pc.printf("Now go to Approach mode!!"); @@ -1330,7 +1330,8 @@ */ case Approach: - autopwm[THR] = SetTHRinRatio(g_loopTHR); //0.7;スロットルの割合 + //autopwm[THR] = SetTHRinRatio(g_loopTHR); //0.7;スロットルの割合 + autopwm[THR] = 1180+320*2*0.3; UpdateTargetAngle_Approach(targetAngle); break; @@ -1444,6 +1445,7 @@ switch(g_landingcommand){ case 'R': //右旋回セヨ + NVIC_EnableIRQ(USART2_IRQn); if(zeroTHR==false){ UpdateTargetAngle_Rightloop_zero(targetAngle); } @@ -1458,10 +1460,11 @@ autopwm[AIL_R]=autopwm[AIL_R]+AIL_R_correctionrightloop; } } - NVIC_EnableIRQ(USART2_IRQn); + break; case 'L': //左旋回セヨ + NVIC_EnableIRQ(USART2_IRQn); if(zeroTHR==false){ UpdateTargetAngle_Leftloop_zero(targetAngle); } @@ -1474,10 +1477,11 @@ } else autopwm[AIL_L]=trimpwm[AIL_L]+AIL_L_correctionleftloop+(autopwm[AIL_R]-trimpwm[AIL_R])*AIL_L_RatioDescent; } - NVIC_EnableIRQ(USART2_IRQn); + break; case 'G': //直進セヨ + NVIC_EnableIRQ(USART2_IRQn); if(zeroTHR==false){ UpdateTargetAngle_GoStraight_zero(targetAngle); } @@ -1485,18 +1489,19 @@ targetAngle[ROLL] = g_gostraightROLL; targetAngle[PITCH] = g_gostraightPITCH; } - NVIC_EnableIRQ(USART2_IRQn); + break; case 'Y': //指定ノヨー方向ニ移動セヨ + NVIC_EnableIRQ(USART2_IRQn); Rotate(targetAngle, g_SerialTargetYAW); if(zeroTHR==false){ autopwm[THR]=minpwm[THR]; } - NVIC_EnableIRQ(USART2_IRQn); break; case 'U': //機首ヲ上ゲヨ + NVIC_EnableIRQ(USART2_IRQn); static int UpCounter=0; UpCounter++; if(UpCounter==3){ @@ -1517,7 +1522,6 @@ } } - NVIC_EnableIRQ(USART2_IRQn); break; @@ -1527,16 +1531,17 @@ break;*/ case 'B': //物資ヲ落トセ + NVIC_EnableIRQ(USART2_IRQn); Chicken_Drop(); - NVIC_EnableIRQ(USART2_IRQn); + break; case 'C': //停止セヨ - targetAngle[ROLL] = 0.0; + NVIC_EnableIRQ(USART2_IRQn); + targetAngle[ROLL] = g_gostraightROLL; targetAngle[PITCH] = -3.0; autopwm[THR] = minpwm[THR]; zeroTHR=false; - NVIC_EnableIRQ(USART2_IRQn); break; default :