 const byte CHAR_ARRAY_SIZE = BYTE_MAX;
 
 //The allowed margin from the cutover min/max input
-const byte CUTOVER_MARGIN = 125;
+const byte CUTOVER_MARGIN = 100;
 
 //Number of cutover samples to use for cutoverInAverage
 const byte CUTOVER_SAMPLE_SIZE = 10;

    if (root.containsKey("throttle")) {
      processServoJson(root["throttle"], throttle, "throttle", listenForThrottle, "Unassigned throttle pin");
    }

    //Reset newData to false so we can read new serial input
    newData = false;
  }
}

//Processes received JSON for a given servo (e.g. ServoData struct)
//The inputISR is the interrupt service routine function for triggering action upon receiver input
void processServoJson(JsonObject& servoJson, ServoData& servoData, const char servoType[], void inputISR(), const char servoError[]) {
  if (!receiverControl) {
    //Check for any output configuration parameters for this servo
    if (servoJson.containsKey("outputConfig")) {
      JsonObject& outputConfig = servoJson["outputConfig"];
      if (outputConfig.containsKey("max")) {
        servoData.outputMax = (byte) outputConfig["max"];
      }
      if (outputConfig.containsKey("min")) {
        servoData.outputMin = (byte) outputConfig["min"];
      }
      if (outputConfig.containsKey("pin")) {
        if (servoData.servo.attached()) servoData.servo.detach();
        byte servoOutPin = (byte) outputConfig["pin"];
        servoData.servo.attach(servoOutPin);
      }
    }
    //Check for any input configuration parameters for this servo
    if (servoJson.containsKey("inputConfig")) {
      JsonObject& inputConfig = servoJson["inputConfig"];
      if (inputConfig.containsKey("max")) {
        servoData.inputMax = (uint16_t) inputConfig["max"];
      }
      if (inputConfig.containsKey("min")) {
        servoData.inputMin = (uint16_t) inputConfig["min"];
      }
      if (inputConfig.containsKey("pin")) {
        if (servoData.inputPin != BYTE_MAX) PCintPort::detachInterrupt(servoData.inputPin);
        servoData.inputPin = (byte) inputConfig["pin"];
        PCintPort::attachInterrupt(servoData.inputPin, inputISR, CHANGE);
      }
      if (inputConfig.containsKey("receiverOnly")) {
        servoData.receiverInputOnly = (boolean) inputConfig["receiverOnly"];
      }
    }
    //Only write to servo if the phone input for this servo has permission to do so
    if (!servoData.receiverInputOnly) {
      //Check for any servo output values to write to the servo
      if (servoJson.containsKey("value")) {
        if (servoData.servo.attached()) {
          byte value = (byte) servoJson["value"];
          servoData.servo.write(value);
          sendJsonServoOutput(servoType, value);
        } else {
          sendJsonString("error", servoError);
        }
      }
    }
  } else {
    sendJsonString("error", "Disable receiver control to configure servos");
  }
}



//Determines whether a given value is valid receiver input
boolean isValidReceiverInput(uint16_t receiverInput) {
  return receiverInput < RECEIVER_INPUT_MAX && receiverInput > RECEIVER_INPUT_MIN;
}

//Processes receiver input for a given servo and writes the converted output to the servo
