zeroTHRの不具合を修正 28,29,30は使用不可

Dependencies:   HCSR04_2 MPU6050_2 mbed SDFileSystem3

Fork of Autoflight2018_30 by 航空研究会

Revision:
11:c0b9ad25d3db
Parent:
10:652071c20bf6
Child:
12:763bf416ba4b
--- a/main.cpp	Sat Sep 15 15:34:20 2018 +0000
+++ b/main.cpp	Sat Sep 15 20:28:15 2018 +0000
@@ -351,7 +351,7 @@
     UpdateAutoPWM(controlValue);
     NVIC_EnableIRQ(USART1_IRQn);
     NVIC_EnableIRQ(USART2_IRQn);
-    wait_ms(20);
+    wait_ms(23);
     pc.printf("%c",g_landingcommand);
 #if DEBUG_PRINT_INLOOP
     DebugPrint();
@@ -922,13 +922,18 @@
         static char SFbuf[16];
         static int bufcounter=0;
         
-        pc.printf("%d",bufcounter);
+
         
         SFbuf[bufcounter]=pc.getc();
+        
+        
+        pc.printf("%c",SFbuf[bufcounter]);
+        
         if(SFbuf[0]=='S'&&bufcounter<5) bufcounter++;
             
         if(bufcounter==5 && SFbuf[4]=='F'){
             g_landingcommand = SFbuf[1];
+            wait_ms(5);
             if(g_landingcommand=='Y')g_SerialTargetYAW = ConvertByteintoFloat(SFbuf[2], SFbuf[3]);
             bufcounter = 0;
             memset(SFbuf, 0, strlen(SFbuf));
@@ -938,6 +943,7 @@
                 pc.printf("Communication Falsed.\r\n");
                 bufcounter = 0;
             }
+            
     }
     
 float ConvertByteintoFloat(char high, char low){