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_51 by
Diff: main.cpp
- Revision:
- 41:3b8c250ae79c
- Parent:
- 40:f03b62a3b495
--- a/main.cpp Wed Sep 26 04:02:25 2018 +0000
+++ b/main.cpp Wed Sep 26 04:13:36 2018 +0000
@@ -994,16 +994,17 @@
//pc.printf("%d\r\n",sbus.failsafe_status);
if(sbus.failsafe_status==SBUS_SIGNAL_LOST||sbus.failsafe_status==SBUS_SIGNAL_FAILSAFE) FailsafeCounter++;
- else FailsafeCounter=0;
if(FailsafeCounter>10){
for(uint8_t i=0;i<6;i++) pwm[i] = trimpwm[i];
if(sbus.failsafe_status==SBUS_SIGNAL_OK) OKCounter++;
- if(OKCounter>10) {
- OKCounter=0;
- }
-
+ else OKCounter=0;
+
+ if(OKCounter>5){
+ OKCounter=0;
+ FailsafeCounter=0;
+ }
//pc.printf("%d\r\n",sbus.failsafe_status);
//if(sbus.failsafe_status!=SBUS_SIGNAL_FAILSAFE)break;
@@ -1459,6 +1460,13 @@
Rotate(targetAngle, g_SerialTargetYAW);
NVIC_EnableIRQ(USART2_IRQn);
break;
+
+ case 'U': //機首ヲ上ゲヨ
+ targetAngle[ROLL] = g_gostraightROLL;
+ autopwm[THR] = minpwm[THR];
+ autopwm[ELE] = trimpwm[ELE]-100;
+ NVIC_EnableIRQ(USART2_IRQn);
+ break;
/*case 'B': //ブザーヲ鳴ラセ
//buzzer = 1;
