     Serial.println(central.address());
   }
 }
+
+void updateMotorSpeed(Servo& motor, unsigned char speed) {
+  int microSeconds = map(speed, -128, 127, 1000, 2000);
+
+  motor.writeMicroseconds(microSeconds);
+}
+

// create service
BLEService               sliderService           = BLEService("51d0");

// create switch characteristic
BLECharCharacteristic    motor1Characteristic = BLECharCharacteristic("51d1", BLERead | BLEWrite);

Servo motor1;

void setup() {
  Serial.begin(9600);

  motor1.attach(MOTOR_1_CONTROL_PIN);

  // set advertised local name and service UUID
  blePeripheral.setLocalName("TheKickAssSlider");

    while (central.connected()) {
      // central still connected to peripheral
      if (motor1Characteristic.written()) {
        updateMotorSpeed(motor1, motor1Characteristic.value());
      }

      if (motor2Characteristic.written()) {
        updateMotorSpeed(motor2, motor2Characteristic.value());
      }

      if (motor3Characteristic.written()) {
        updateMotorSpeed(motor3, motor3Characteristic.value());
      }

      if (motor4Characteristic.written()) {
        updateMotorSpeed(motor4, motor4Characteristic.value());
      }
    }

