 
   if (ledCharacteristic.written()) {
     // update LED, either central has written to characteristic or button state has changed
+    Serial.println(ledCharacteristic.valueLength());
+    Serial.println(ledCharacteristic.value());
     Serial.println(ledCharacteristic.value());
     if (ledCharacteristic.value()) {
       Serial.println("LED on");


  // add the service
  BLE.addService(ledService);

  ledCharacteristic.setValue(0);

  // start advertising
  BLE.advertise();

  Serial.println("Bluetooth device active, waiting for connections...");
}

void loop() {

  }
}

void ledSignal(int times, int milliseconds){
  for(int i=0; i<times; i++){
    digitalWrite(ledPin, HIGH);
    delay(milliseconds);
    digitalWrite(ledPin, LOW);
    delay(milliseconds);
  }
}
