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:
- 18:cce82f3374fc
- Parent:
- 17:55249ea37dff
- Child:
- 19:0955311b0db6
--- a/main.cpp Mon Sep 17 10:07:27 2018 +0000
+++ b/main.cpp Mon Sep 17 12:01:13 2018 +0000
@@ -57,7 +57,7 @@
#define glideloopRUD 1300
*/
#define AIL_R_correctionrightloop 0
-#define AIL_L_correctionrightloop -400
+#define AIL_L_correctionrightloop 0
#define AIL_L_correctionrightloopshort 0
#define AIL_L_correctionleftloop -0
#define AIL_L_correctionleftloopshort 0
@@ -151,9 +151,9 @@
static int16_t autopwm[8] = {1500,1500,1180,1500,1392,1500};
//1号機
-static int16_t trimpwm[6] = {1500,1500,1180,1500,1392,1600};
-int16_t maxpwm[6] = {1820,1820,1820,1820,1820,1820};
-int16_t minpwm[6] = {1180,1180,1180,1180,1180,1180};
+static int16_t trimpwm[6] = {1580,1600,1176,1404,1512,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]};
//2号機
@@ -267,6 +267,7 @@
void UpdateTargetAngle_NoseDOWN(float targetAngle[3]);
//デバッグ用
+void Sbusprintf();
void DebugPrint();
/*---関数のプロトタイプ宣言終わり---*/
@@ -281,12 +282,13 @@
loop();
-
+ NVIC_DisableIRQ(USART1_IRQn);
if(!CheckSW_Up(Ch7)){
led3=0;
}else{
led3=1;
}
+ NVIC_EnableIRQ(USART1_IRQn);
}
}
@@ -376,6 +378,7 @@
wait_ms(23);
pc.printf("%c",g_landingcommand);
#if DEBUG_PRINT_INLOOP
+ //Sbusprintf();
DebugPrint();
#endif
}
@@ -738,7 +741,7 @@
else{ *g_glideloopPITCH = GLIDE_PITCH;
SDerrorcount++;
}
- if(GetParameter(fp,paramNames[20],parameter)) *g_kpAIL = atof(parameter);
+ if(GetParameter(fp,paramNames[20],parameter)) *g_kpAIL = atof(parameter);
else{ *g_kpAIL = KP_AIL;
SDerrorcount++;
}
@@ -1459,6 +1462,13 @@
//pc.printf("Roll = %f, PITCH = %f, THR = %d \r\n", targetAngle[ROLL], targetAngle[PITCH], autopwm[THR]);
}
+void Sbusprintf(){
+
+ for(uint8_t i=0; i<8; i++) pc.printf("ch.%d = %d ",i+1,sbus.manualpwm[i]);
+ pc.printf("\r\n");
+
+ }
+
//デバッグ用
void DebugPrint(){
