// Klar, ist ne Quadrixette :)
#define QUADX
// Muss noch höher - hier läuft fast immer ein Motor nicht mit an, manchmal auch ein anderer. Komisch, datt. Aber erst seit Simonk.
#define MINTHROTTLE 1150
#define MAXTHROTTLE 1850
#define MINCOMMAND 1000
#define I2C_SPEED 100000L //100kHz normal mode, this value must be used for a genuine WMP
// Wie im Handbuch...
#define NANOWII // the smallest multiwii FC based on MPU6050 + pro micro based proc <- confirmed by Alex
#define YAW_DIRECTION 1
#define TRI_YAW_CONSTRAINT_MIN 1020
#define TRI_YAW_CONSTRAINT_MAX 2000
#define TRI_YAW_MIDDLE 1500 // tail servo center pos. - use this for initial trim; later trim midpoint via LCD
#define ALLOW_ARM_DISARM_VIA_TX_YAW
#define ALLOW_ARM_DISARM_VIA_TX_ROLL
#define TILT_PITCH_MIN 1020 //servo travel min, don't set it below 1020
#define TILT_PITCH_MAX 2000 //servo travel max, max value=2000
#define TILT_PITCH_MIDDLE 1500 //servo neutral value
#define TILT_PITCH_PROP 10 //servo proportional (tied to angle) ; can be negative to invert movement
#define TILT_ROLL_MIN 1020
#define TILT_ROLL_MAX 2000
#define TILT_ROLL_MIDDLE 1500
#define TILT_ROLL_PROP 10
#define CAM_SERVO_HIGH 2000 // the position of HIGH state servo
#define CAM_SERVO_LOW 1020 // the position of LOW state servo
#define CAM_TIME_HIGH 1000 // the duration of HIGH state servo expressed in ms
#define CAM_TIME_LOW 1000 // the duration of LOW state servo expressed in ms
#define PITCH_DIRECTION_L 1 // left servo - pitch orientation
#define PITCH_DIRECTION_R -1 // right servo - pitch orientation (opposite sign to PITCH_DIRECTION_L, if servos are mounted in mirrored orientation)
#define ROLL_DIRECTION_L 1 // left servo - roll orientation
#define ROLL_DIRECTION_R 1 // right servo - roll orientation (same sign as ROLL_DIRECTION_L, if servos are mounted in mirrored orientation)
#define WING_LEFT_MID 1500 // left servo center pos. - use this for initial trim; later trim midpoint via LCD
#define WING_RIGHT_MID 1500 // right servo center pos. - use this for initial trim; later trim midpoint via LCD
#define WING_LEFT_MIN 1020 // limit servo travel range must be inside [1020;2000]
#define WING_LEFT_MAX 2000 // limit servo travel range must be inside [1020;2000]
#define WING_RIGHT_MIN 1020 // limit servo travel range must be inside [1020;2000]
#define WING_RIGHT_MAX 2000 // limit servo travel range must be inside [1020;2000]
#define SERVO_RATES {100, 100, 100, 100, 100, 100, 100, 100} // Rates in 0-100%
#define SERVO_DIRECTION { -1, 1, 1, -1, 1, 1, 1, 1 } // Invert servos by setting -1
#define FLAPPERON_EP { 1500, 1700 } // Endpooints for flaps on a 2 way switch else set {1020,2000} and program in radio.
#define FLAPPERON_INVERT { 1, -1 } // Change direction om flapperons { Wing1, Wing2 }
#define FLAP_EP { 1500, 1900 } // Endpooints for flaps on a 2 way switch else set {1020,2000} and program in radio.
#define SERVO_OFFSET { 0, 0, 0, 0, 0, 0, 0, 0 } // Adjust Servo MID Offset & Swash angles
#define COLLECTIVE_PITCH THROTTLE
#define SERVO_ENDPOINT_HIGH {2000,2000,2000,2000,2000,2000,2000,2000};
#define SERVO_ENDPOINT_LOW {1020,1020,1020,1020,1020,1020,1020,1020};
#define COLLECTIVE_RANGE { 80, 1500, 80 }// {Min%, ZeroPitch, Max%}.
#define YAW_CENTER 1500 // Use servo[5] SERVO_ENDPOINT_HIGH/LOW for the endpoits.
#define YAWMOTOR 0 // If a motor is useed as YAW Set to 1 else set to 0.
#define SERVO_NICK { +10, -10, -0 }
#define SERVO_LEFT { +10, +5, +10 }
#define SERVO_RIGHT { +10, +5, -10 }
#define SERVO_DIRECTIONS { +1, -1, -1 } // -1 will invert servo
#define CONTROLL_RANGE { 100, 100 } // { ROLL,PITCH }
#define SINGLECOPTRER_YAW {1, 1, 1, 1} // Left, Right,Front,Rear
#define SINGLECOPTRER_SERVO {1,-1, 1,-1} // Pitch,Pitch,Roll, Roll
#define DUALCOPTER_SERVO {1,1} //Pitch,Roll
// Damit der AUX2 an Pin D17 funktioniert - noch ungenutzt, evtl mal LED-Leisten dran.
#define RCAUX2PIND17
#define SERIAL_COM_SPEED 115200
#define INTERLEAVING_DELAY 3000
#define NEUTRALIZE_DELAY 100000
#define FAILSAVE_DELAY 10 // Guard time for failsafe activation after signal lost. 1 step = 0.1sec - 1sec in example
#define FAILSAVE_OFF_DELAY 200 // Time for Landing before motors stop in 0.1sec. 1 step = 0.1sec - 20sec in example
#define FAILSAVE_THROTTLE (MINTHROTTLE + 200) // Throttle level used for landing - may be relative to MINTHROTTLE - as in this case
#define GPS_BAUD 115200
#define GPS_LED_INDICATOR
#define NAV_CONTROLS_HEADING true // copter faces toward the navigation point, maghold must be enabled for it
#define NAV_TAIL_FIRST false // true - copter comes in with tail first
#define NAV_SET_TAKEOFF_HEADING true // true - when copter arrives to home position it rotates it's head to takeoff direction
#define MAG_DECLINIATION 0.0f
#define GPS_FILTERING // add a 5 element moving average filter to GPS coordinates, helps eliminate gps noise but adds latency comment out to disable
#define GPS_LOW_SPEED_D_FILTER // below .5m/s speed ignore D term for POSHOLD_RATE, theoretically this also removed D term induced noise commnent out to disable
#define GPS_WP_RADIUS 200 // if we are within this distance to a waypoint then we consider it reached (distance is in cm)
#define NAV_SLEW_RATE 30 // Adds a rate control to nav output, will smoothen out nav angle spikes
#define LCD_MENU_PREV 'a'
#define LCD_MENU_NEXT 'c'
#define LCD_VALUE_UP 'd'
#define LCD_VALUE_DOWN 'b'
#define LCD_MENU_SAVE_EXIT 's'
#define LCD_MENU_ABORT 'x'
#define VBATREF 24
#define SUPPRESS_TELEMETRY_PAGE_3
#define SUPPRESS_TELEMETRY_PAGE_4
#define SUPPRESS_TELEMETRY_PAGE_5
#define SUPPRESS_TELEMETRY_PAGE_6
#define SUPPRESS_TELEMETRY_PAGE_7
#define SUPPRESS_TELEMETRY_PAGE_8
#define SUPPRESS_TELEMETRY_PAGE_9
// Buzzer muss an, zwecks Lipo-Überwachung
#define BUZZER
// Für LiPo-Überwachung
#define VBAT // uncomment this line to activate the vbat code
// VBScale durch ausprobiert eingestellt. Was die Rechner im Internet ausspucken, war falsch. 128 ist für 33kO und 56kO wie im NanoWii-PDF und 3S
#define VBATSCALE 128 // change this value if readed Battery voltage is different than real voltage
#define VBATLEVEL1_3S 107 // 10,7V
#define VBATLEVEL2_3S 103 // 10,3V
#define VBATLEVEL3_3S 99 // 9.9V
#define NO_VBAT 16 // Avoid beeping without any battery
//OKO #define VBATLEVEL1_3S 120 // 10,7V zum Trockentesten auf der Werkbank
//OKO #define VBATLEVEL2_3S 119 // 10,3V zum Trockentesten auf der Werkbank
//OKO #define VBATLEVEL3_3S 118 // 9.9V zum Trockentesten auf der Werkbank
#define PLEVELSCALE 50 // if you change this value for other granularity, you must search for comments in code to change accordingly
#define PLEVELDIV 5000 // default for soft - if you lower PLEVELDIV, beware of overrun in uint32 pMeter
#define PLEVELDIVSOFT PLEVELDIV // for soft always equal to PLEVELDIV; for hard set to 5000
#define PSENSORNULL 510 // for I=0A my sensor gives 1/2 Vss; that is approx 2.49Volt
#define PINT2mA 13 // for telemtry display: one integer step on arduino analog translates to mA (example 4.9 / 37 * 100
#define MIDRC 1500
#define SERVO_RFR_50HZ
#define ESC_CALIB_LOW MINCOMMAND
#define ESC_CALIB_HIGH 2000
#define LCD_TELEMETRY_FREQ 23 // to send telemetry data over serial 23 <=> 60ms <=> 16Hz (only sending interlaced, so 8Hz update rate)
#define LCD_TELEMETRY_AUTO_FREQ 667 // to step to next telemetry page 667 <=> 2s
#define PSENSORFREQ 6 // to read hardware powermeter sensor 6 <=> 18ms
#define VBATFREQ PSENSORFREQ // to read battery voltage - keep equal to PSENSORFREQ unless you know what you are doing