       rgbLED(255, 0, 0);
       beep(50);
       servo_state = 0;
+      //servo.detach();
     } 
     else {
       Serial.println("Servo enabled");

  pinMode(BUTTON_PIN, INPUT);

  // Initialize servo
  servo.attach(SERVO_PIN);

  // Initialize speaker
  pinMode(SPEAKER_PIN, OUTPUT);

      rgbLED(0, 255, 0);
      beep(50);
      servo_state = 1;
      servo.attach(SERVO_PIN);
    }

    while (digitalRead(BUTTON_PIN) == HIGH);
