 //Most of this method code is taken from: https://forum.arduino.cc/index.php?topic=288234.0
 void readSerialJsonInput() {
   static boolean receiveInProgress = false;  //Determines if a char received via serial input belongs to the current json input char array
-  static int index = 0;  //Index for storing the most recently received serial input in the correct place in the input char array
+  static byte index = 0;  //Index for storing the most recently received serial input in the correct place in the input char array
   char charIn;  //Char being currently read from serial input
 
   //Only attempt to read data when serial input is available

  //Static variables are used because they maintain their value over multiple function calls
  static byte servoInputFlagsLocal;
  static uint16_t aileronInValueLocal;
  static uint16_t elevatorInValueLocal;
  static uint16_t rudderInValueLocal;
  static uint16_t throttleInValueLocal;
  static uint16_t cutoverInValueLocal;

  //If any servo input byte flags were set in any of the ISR methods, process them here
  if (servoInputFlags != 0) {

        manualControl = (boolean) root["manualControl"];
        sendJson("manualControl", manualControl);
      } else {
        sendJson("error", "Calibration required");
      }
    }

    //Enable or disable calibration mode
    if (root.containsKey("calibrationMode")) {
      if (!manualControl) {
        calibrationMode = (boolean) root["calibrationMode"];
        sendJson("calibrationMode", calibrationMode);
        if (calibrationMode) {
          resetCalibration();
        } else {
          if (calibrationComplete()) isCalibrated = true;
          sendCalibrationJsonData();
        }
      } else {
        sendJson("error", "Disable manual control");
      }
    }

