     Serial.println(command);
 
     if( command.substring(0,9) == "Light ON;" ) {
+      lightOn = HIGH;
       digitalWrite( LED_PIN, HIGH );
     }
     else if ( command.substring(0,10) == "Light OFF;" ) {
+      lightOn = LOW;
       digitalWrite( LED_PIN, LOW );
     }
     else if ( command.substring(0,5) == "Servo" ) {
-        String servoSpeed = command.substring(6,command.indexOf(';'));
-        analogWrite(SERVO_PIN, servoSpeed.toInt());
+        String servoPos = command.substring(6,command.indexOf(';'));
+        myservo.write(servoPos.toInt());
     }
 
     


  pinMode(BTN_PIN,INPUT);
  pinMode(LED_PIN,OUTPUT);
  pinMode(SERVO_PIN, OUTPUT);
  pinMode(POT_PIN, INPUT);
  digitalWrite( LED_PIN, LOW );
  
  // Init. and start BLE library.
  ble_begin();

String command;
int buttonState = 0;
int potVal = 0;
bool lightOn = LOW;
int strobeMode = 0;

int delayVals[4] = {0,100,70,30};

void loop()
{
