KK2.0 v1.6++ Revision 1
Features
- This custom firmware was written by me for the KK2.0 controller and it has the following features:
- This version is for traditional receivers only. All CPPM code was removed.
- The 'SL stick activation' feature was removed so aileron input can no longer be used to turn 'Self-level' mode on and off.
- NEW: Customizable AUX switch functions. Read the instructions below.
- NEW: Adjustable LCD contrast.
- NEW: Battery voltage is logged and displayed on the SAFE screen.
- NEW: Button and arming beeps can be turned off individually.
- NEW: The KK2 LED is flashing in sync with the LVA (Low Voltage Alarm) beeps.
- Updated: 'SL stick mixing' mode with three settings (Low, Medium and High) controlled from the AUX switch. This will give a soft transition from Self-level to ACRO mode based on aileron/elevator stick deflection. The selected setting will be displayed on the SAFE screen as "SL MIX LOW", "SL MIX MED." or "SL MIX HIGH".
- ESC calibration is now done without a transmitter and it is sufficient to hold down a single button. This will help users with slow binding receivers do ESC calibration in a simple and safe way. Read the instructions below to learn the new ESC calibration routine.
- Updated: Alarm (i.e. 'Lost Model Alarm') can be activated from the AUX switch, but it will also sound after 20 seconds (i.e. after the Auto Disarm countdown) if AUX switch position 1 is selected (or if AUX signal is absent).
- Support for gimbals with differential mixing (in addition to normal gimbals). This is configurable from the 'Camera Stab Settings' screen. Borrowed from Brontide's firmware.
- A 'Factory Reset' will clear the mixer table instead of loading the QUAD+ motor layout. This feature is borrowed from Brontide's firmware and further improved by me. An error message (i.e. "No motor layout") is displayed on the SAFE screen and arming is refused until a motor layout has been loaded.
- Gyro limits have been expanded to let boards with slightly damaged gyros arm. Values borrowed from Steveis' firmware.
- The 'Version Info' screen is now accessible from the main menu and is not displayed during start-up anymore. Start-up time is reduced by one second thanks to this change.
- Updated: Made several changes to the GUI. Hope you'll like them. 
- It is based on the original KK2.0 1V6 firmware by Rolf Bakke. Thanks. 

I have tested this firmware on my own RC models and it works without problems for me, but please read the warning below to understand the risks of using this firmware on a damaged KK2.0 board. I would hate to see anybody get hurt by using this firmware, so please take care.

WARNING!
DO NOT USE THIS FIRMWARE IF YOUR KK2.0 BOARD SUFFERS FROM DAMAGED BUTTONS OR IF YOUR ESCs HAVE PROBLEMS ENTERING CALIBRATION MODE!
IF A SINGLE BUTTON IS STUCK IN 'DOWN' POSITION AND YOUR ESCs FAIL TO ENTER CALIBRATION MODE, YOUR MOTORS WILL GO FULL THROTTLE AS SOON AS YOU PLUG IN YOUR FLIGHT BATTERY AND THEY CANNOT BE SHUT DOWN FROM YOUR TRANSMITTER! 

REMEMBER: YOU USE THIS FIRMWARE AT YOUR OWN RISK!

Yes, that was a serious warning, but you should also know that it is perfectly safe to use this firmware as long as all KK2.0 buttons are working properly and your ESCs have no problems entering calibration mode. Don't be afraid to test the new ESC calibration routine with propellers off.
Now that you have read and understood the warning above, we can go on with the new and simplified ESC calibration routine. 

ESC calibration routine (no transmitter required):
1. Remove props, but leave the motors connected so that you can hear the ESC confirmation beeps!
2. Disconnect servos if they cannot handle a sudden change from endpoint to endpoint.
3. Hold down any* button (i.e. a single button), except for the leftmost one, while connecting the flight battery.
4. Keep holding the button down while waiting for the 'High throttle' level beep(s) and then release it to set the 'Low throttle' level.
5. Push button 1 (labeled 'EXIT') after the final ESC confirmation beeps to return to the 'SAFE' screen.

* If you hold down button 1 while connecting the battery you'll see a warning (and probably hear some 'angry' beeps). Just disconnect the battery and try again (holding down a different button this time).

This calibration method will set the upper throttle level to 2.0 ms and the lower throttle level to 1.02 ms, which are the exact same values used by the original KK2.0 1V6 firmware (Don't be fooled by the "Throttle pass-through" message).

I actually recommend testing the new ESC calibration routine (WITH PROPELLERS OFF) at least once to see if your ESCs have problems entering calibration mode. Do not use this firmware if your motors spin up!

You will probably notice that the 'Version Information' screen and its one second delay has been removed from the start-up sequence. This will make the ESC calibration routine safer because your ESCs will now see the 'full throttle' signal one second sooner (compared to the original KK2.0 1V6 firmware) and this reduces the risk for having motors going full throttle while doing the ESC calibration.

AUX Switch Setup
From the AUX Switch Setup screen you can select which function (Acro, SL Mix Low, SL Mix Medium, SL Mix High, Normal SL or Alarm) should be active depending on the AUX switch position. Select the item you want to modify and then press the CHANGE button to cycle through the settings mentioned above.

Observe:
- The current AUX switch position will be displayed on the AUX Switch Setup screen to help you assign the wanted function to the preferred switch position. The Receiver Test screen can also be used to observe the AUX switch position values.
- The same function can be assigned to several positions of your AUX switch.
- If you use a 4-channel receiver you can only use the function assigned to position 1 and this function will be active all the time.

SL Stick Mixing
The SL Stick Mixing mode can be activated from a switch assigned to the AUX input channel, but only if you have activated one or more SL Mix functions on the AUX Switch Setup screen.

The mixing setting (LOW, MEDIUM or HIGH) should be selected based on your P-gain setting on the 'Self-level Settings' screen. If your SL P-gain setting is below 30 you should select the LOW setting. I would recommend using the MEDIUM setting for SL P-gains in the 30 to 60 range and HIGH for gain values above 60 and up to 100. It is not recommended to use this feature for SL P-gain values above 100.

I use this mode all the time now and found that it is great for practicing aerobatics and if you get in trouble (e.g. lose orientation) you can just center the aileron/elevator stick and the model will level itself. Another advantage is that you don't have to ramp up your 'Stick Scaling' values for flying around (compared to the original Self-level mode in KK2.0 1V6).

BEWARE! If you center your aileron/elevator stick while your model is upside-down it will remain inverted until you add some more stick input. This is a "feature" of the original KK2 firmware and not something that I've implemented. 

Observe:
- You should tune your model as best as you can in both acro and SL mode before trying the SL Stick Mixing modes.
- Don't count on this mode saving your model if you perform acrobatic stunts and exceed the 440 degrees/second gyro limitation. It may actually make it worse! 
- If your model has built up any momentum, it will not stop moving immediately after centering the aileron/elevator stick! Take it slow if you're at beginner level.
- This mode will work best for transmitters configured to use mode 2 or 3 (i.e. with aileron and elevator on the same stick).
- Avoid using this mode if your model requires excessive stick trimming (e.g. when center of gravity is too far off). This will affect the SL mixing. In other words: You should only use this mode on a well-balanced model.

Lost Model Alarm
The Lost Model alarm can be triggered from a switch assigned to the AUX input channel, but only if you have activated the Alarm function on the AUX Switch Setup screen.

If you use a 4-channel receiver you can still use the Lost Model Alarm feature. All you have to do is wait 20 seconds for the Auto Disarm feature (must be active) to disarm your KK2 board. The alarm will not sound if you disarm your KK2 manually and the alarm will stop when you arm your board again.
This method can also be used if you have more than four channels on your receiver, but then your AUX switch must be set to position 1 as the Auto Disarm function disarms your KK2 board.

Observe:
- A short delay was added to prevent the alarm from being trigged unintentionally when flipping the switch from position 1 to 3 with the alarm function assigned to the middle position of a 3-way switch.
- The alarm will still be triggered after 30 minutes counted from the last arm/disarm operation, just like in the original KK2.0 1V6 firmware.

Button/Arming Beeps
The Mode Settings screen now has independent settings for "Button Beep" and "Arming Beeps". Setting Button Beep to NO will remove the short 'clicking' sound produced when you push a button on the KK2 board. Setting Arming Beeps to NO will remove the loud beep produced during arming and disarming.

Observe:
- Do not disable the arming beeps if your KK2 board is covered by a canopy (or anything else) that blocks the view of the LED or LCD display.
- The start-up beep is not affected by these settings. It is there to test the piezo buzzer.
- Alarms and other beeps are unaffected as well (e.g. short beeps while throttle is idle).

LCD Contrast
The LCD contrast can now be adjusted within a limited range. Go to the LCD Contrast screen and use the UP and DOWN buttons to adjust, then press the SAVE button to save your new setting and exit.

Observe:
- Pushing the BACK button will reload the last saved contrast setting.
- If you should end up with an unreadable screen, you can hold down button 1 while connecting your flight battery to reset the LCD contrast value.

Enjoy! 
Please read the information above (and especially the warning) before downloading this firmware.
Remember to write down your settings, for this firmware will certainly erase them all!
