added relay control to CH6

git-svn-id: https://arducopter.googlecode.com/svn/trunk@2943 f9c3cf11-9bcb-44bc-f272-b75c42450872
This commit is contained in:
jphelirc 2011-07-26 03:37:41 +00:00
parent 580f981d30
commit f2d3c0a246
5 changed files with 18 additions and 3 deletions

View File

@ -18,15 +18,15 @@
HELI_FRAME HELI_FRAME
*/ */
//#define FRAME_ORIENTATION X_FRAME //#define FRAME_ORIENTATION PLUS_FRAME
/* /*
PLUS_FRAME PLUS_FRAME
X_FRAME X_FRAME
V_FRAME V_FRAME
*/ */
//#define CHANNEL_6_TUNING CH6_NONE //#define CHANNEL_6_TUNING CH6_RELAY
/* /*
CH6_NONE CH6_NONE
CH6_STABILIZE_KP CH6_STABILIZE_KP
@ -41,6 +41,7 @@
CH6_YAW_RATE_KI CH6_YAW_RATE_KI
CH6_TOP_BOTTOM_RATIO CH6_TOP_BOTTOM_RATIO
CH6_PMAX CH6_PMAX
CH6_RELAY
*/ */
// experimental!! // experimental!!

View File

@ -1514,7 +1514,14 @@ static void tuning(){
#elif CHANNEL_6_TUNING == CH6_PMAX #elif CHANNEL_6_TUNING == CH6_PMAX
g.pitch_max.set(g.rc_6.control_in * 2); // 0 to 2000 g.pitch_max.set(g.rc_6.control_in * 2); // 0 to 2000
// Simple relay control
#elif CHANNEL_6_TUNING == CH6_RELAY
if(g.rc_6.control_in <= 600) relay_on();
if(g.rc_6.control_in >= 400) relay_off();
#endif #endif
} }
static void update_nav_wp() static void update_nav_wp()

View File

@ -147,6 +147,7 @@
// Extras // Extras
#define CH6_TOP_BOTTOM_RATIO 11 #define CH6_TOP_BOTTOM_RATIO 11
#define CH6_PMAX 12 #define CH6_PMAX 12
#define CH6_RELAY 13
// nav byte mask // nav byte mask

View File

@ -55,6 +55,9 @@ static void init_rc_in()
#elif CHANNEL_6_TUNING == CH6_TOP_BOTTOM_RATIO #elif CHANNEL_6_TUNING == CH6_TOP_BOTTOM_RATIO
g.rc_6.set_range(800,1000); // .8 to 1 g.rc_6.set_range(800,1000); // .8 to 1
/* #elif CHANNEL_6_TUNING == CH6_RELAY
g.rc_6.set_range(0,1000); // 0 to 1 */
#endif #endif
} }

View File

@ -743,6 +743,9 @@ test_tuning(uint8_t argc, const Menu::arg *argv)
#elif CHANNEL_6_TUNING == CH6_PMAX #elif CHANNEL_6_TUNING == CH6_PMAX
Serial.printf_P(PSTR("Y6: %d\n"), (g.rc_6.control_in * 2)); Serial.printf_P(PSTR("Y6: %d\n"), (g.rc_6.control_in * 2));
#elif CHANNEL_6_TUNING == CH6_RELAY
Serial.printf_P(PSTR(" %d\n"), (g.rc_6.control_in ));
#endif #endif
if(Serial.available() > 0){ if(Serial.available() > 0){