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:
- 15:43427b0241d9
- Parent:
- 14:bbd5ff31fb67
- Child:
- 16:7fca5b938da6
--- a/main.cpp Sun Sep 16 11:17:50 2018 +0000
+++ b/main.cpp Mon Sep 17 06:40:41 2018 +0000
@@ -108,10 +108,6 @@
const int16_t lengthdivpwm = 320;
const int16_t changeModeCount = 6;
-const float trim[4] = {Trim_Falfalla[0],Trim_Falfalla[1],Trim_Falfalla[2],Trim_Falfalla[3]};
-const float expMax[4] = {ExpMax_Falfalla[0],ExpMax_Falfalla[1],ExpMax_Falfalla[2],ExpMax_Falfalla[3]};
-const float expMin[4] = {ExpMin_Falfalla[0],ExpMin_Falfalla[1],ExpMin_Falfalla[2],ExpMin_Falfalla[3]};
-const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
SBUS sbus(PA_9, PA_10); //SBUS
@@ -150,10 +146,23 @@
static OutputStatus output_status = Manual;
OperationMode operation_mode = StartUp;
BombingMode bombing_mode = Takeoff;
+
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};
+const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
+
+//2号機
+/*
+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};
+const int16_t reverce[4] = {Reverce_falfalla[0],Reverce_falfalla[1],Reverce_falfalla[2],Reverce_falfalla[3]};
+*/
+
int16_t oldTHR = 1000;
int16_t g_AIL_L_Ratio_rightloop = 0.5;
@@ -207,11 +216,9 @@
void Output_PWM(int16_t pwm[6]); //pwmをサーボへ出力
//シリアル割り込み
-void SendSerial(); //1文字きたら送り返す
-void SendArray();
void getSF_Serial();
float ConvertByteintoFloat(char high, char low);
-void ISR_Serial_Rx();
+
//SD設定
int GetParameter(FILE *fp, const char *paramName,char parameter[]);
@@ -416,11 +423,6 @@
}
void Init_PWM(){
- for (uint8_t i = 0; i < 6; ++i){
- trimpwm[i] = 1500 + (int16_t)(lengthdivpwm * (trim[i]/100));
- maxpwm[i] = 1500 + (int16_t)(lengthdivpwm * (expMax[i]/100));
- minpwm[i] = 1500 - (int16_t)(lengthdivpwm * (expMin[i]/100));
- }
pc.printf("PWM initialized\r\n");
}
