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_36 by
Diff: main.cpp
- Revision:
- 29:887a38540508
- Parent:
- 28:aa44903a01e1
- Child:
- 30:624cb32e13a3
--- a/main.cpp Fri Sep 21 20:03:32 2018 +0000
+++ b/main.cpp Sat Sep 22 04:31:11 2018 +0000
@@ -151,10 +151,10 @@
OperationMode operation_mode = StartUp;
BombingMode bombing_mode = Takeoff;
-static int16_t autopwm[8] = {1500,1500,1180,1500,1392,1500};
+static int16_t autopwm[8] = {1500,1500,1180,1500,1512,1500};
//1号機
-static int16_t trimpwm[6] = {1580,1600,1176,1404,1512,1448};
+static int16_t trimpwm[6] = {1580,1600,1176,1404,1632,1448};
int16_t maxpwm[6] = {1796,1936,1848,1740,1820,1856};
int16_t minpwm[6] = {1182,1265,1176,1068,1180,1176};
const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
@@ -290,13 +290,13 @@
loop();
- //NVIC_DisableIRQ(USART1_IRQn);
+ NVIC_DisableIRQ(USART1_IRQn);
if(!CheckSW_Up(Ch7)){
led3=0;
}else{
led3=1;
}
- //NVIC_EnableIRQ(USART1_IRQn);
+ NVIC_EnableIRQ(USART1_IRQn);
}
}
@@ -395,7 +395,7 @@
//pc.printf("%c",g_landingcommand);
//NVIC_EnableIRQ(USART2_IRQn);
#if DEBUG_PRINT_INLOOP
- //Sbusprintf();
+ Sbusprintf();
//DebugPrint();
#endif
}
@@ -616,7 +616,6 @@
return 1;
}
}
- return 0;
}
@@ -943,8 +942,6 @@
for(uint8_t i=0;i<6;i++){
pwm[i] = sbus.manualpwm[i];
}
- /*pc.printf("%d ,",pwm[0]);//R
- pc.printf("%d ,\r\n",pwm[5]);//L*/
oldTHR = sbus.manualpwm[THR];
//pc.printf("update_manual\r\n");
NVIC_EnableIRQ(USART1_IRQn);
@@ -957,9 +954,7 @@
pwm[RUD] = autopwm[RUD];
pwm[DROP] = autopwm[DROP];
pwm[AIL_L] = autopwm[AIL_L];
- //pc.printf("%d ,",pwm[AIL_R]);//R
- //pc.printf("%d ,\r\n",pwm[AIL_L]);//L
- //pc.printf("update_auto\r\n");
+
NVIC_EnableIRQ(USART1_IRQn);
break;
@@ -1073,7 +1068,7 @@
//pc.printf("x");
return;
}
- }
+
//pc.printf("%c",SFbuf[bufcounter]);
@@ -1097,7 +1092,7 @@
bufcounter = 0;
NVIC_ClearPendingIRQ(USART2_IRQn);
}
-
+ }
//NVIC_EnableIRQ(TIM5_IRQn);
//NVIC_EnableIRQ(EXTI0_IRQn);
@@ -1302,7 +1297,7 @@
//チキラー投下
void Chicken_Drop(){
if(CheckSW_Up(Ch7)){
- autopwm[DROP] = 1512;
+ autopwm[DROP] = 1632;
pc.printf("Bombed!\r\n");
RerurnChickenServo1.attach(&ReturnChickenServo1, 3);
//operation_mode = Approach;
@@ -1389,12 +1384,12 @@
NVIC_EnableIRQ(USART2_IRQn);
break;
- case 'B': //ブザーヲ鳴ラセ
+ /*case 'B': //ブザーヲ鳴ラセ
//buzzer = 1;
NVIC_EnableIRQ(USART2_IRQn);
- break;
+ break;*/
- case 'D': //物資ヲ落トセ
+ case 'B': //物資ヲ落トセ
Chicken_Drop();
NVIC_EnableIRQ(USART2_IRQn);
break;
