 }
 
 //Example JSON strings below:
-//@{"config":{"throttle":10, "elevator":9, "rudder":8, "aileron":7, "aileronIn":6, "throttleIn":5, "elevatorIn":4, "rudderIn":3, "cutoverIn":2}, "throttle": 32, "elevator": 90, "rudder": 90, "aileron": 90}#
-//@{"throttle":0, "elevator":100, "aileron":120, "rudder":75}#
+//@{"config":{"throttle":10, "elevator":9, "rudder":8, "aileron":7, "aileronIn":6, "throttleIn":5, "elevatorIn":4, "rudderIn":3, "cutoverIn":2}, "servos":{"throttle":32, "elevator":90, "rudder":90, "aileron":90}}#
+//@{"calibration":{"aileronInMin":1084,"aileronInMax":1688,"elevatorInMin":964,"elevatorInMax":1752,"rudderInMin":1044,"rudderInMax":1800,"throttleInMin":1020,"throttleInMax":1704,"cutoverInMin":776,"cutoverInMax":1844}}#
+//@{"ranges":{"aileronMin":45, "aileronMax":135, "elevatorMin":0, "elevatorMax":180, "rudderMin":0, "rudderMax":180, "throttleMin":32, "throttleMax":124}}#
+//@{"servos":{"throttle":0, "elevator":100, "aileron":120, "rudder":75}}#
 void processReceivedJson() {
   if (newData) {
     StaticJsonBuffer<CHAR_ARRAY_SIZE> jsonBuffer;

volatile uint16_t throttleInValue;

//Stores the pin number for each receiver input
int aileronInPin = -1;
int cutoverInPin = -1;
int elevatorInPin = -1;
int rudderInPin = -1;
int throttleInPin = -1;

//Determines if the servos are in the process of calibration
boolean calibrationMode = false;

//Min and max values for the Servo.write() function
const byte SERVO_MIN = 0;
const byte SERVO_MAX = 180;

//Default servo input value
//TODO use better calibration default
