 // Debounce parameters (expressed in ms)
 unsigned long lastDebounceTime = 0;     /**< @brief The last time rotary encoder switch button was toggled */
 unsigned long debounceDelay = 250;      /**< @brief The debounce time */
+
+bool isMediaPlayerDetected = false;     /**< @brief Tells if a media player hase been detected or not */
 
 // Forward declarations
 void doEncoder_Expanded();

        keySent = true;

        if (key == MEDIA_PLAY_PAUSE) {
            display.setCursor(10, 10);
            display.println("PLAY/PAUSE");
            display.display();
        }
        else if (key == MEDIA_VOLUME_UP) {
            display.setCursor(10, 10);
            display.println("VOLUME UP");
            display.display();
        }
        else if (key == MEDIA_VOLUME_DOWN) {
            display.setCursor(10, 10);
            display.println("VOLUME DOWN");
            display.display();

    display.display();

    delay(2000);
    display.clearDisplay();
    display.display();
}


void loop() {
    display.clearDisplay();

    if (!isMediaPlayerDetected) {
        display.setCursor(0, 0);
        display.println("No media player");
        display.println("detected");
    }

    display.display();

    if (!keySent) {
