   Arduino control code for a music maker board and a trellis keypad.
 
   The control code shall
-   * read trellis keys
-   * on key press play a music file from the micro SD card from a specific folder and blink the respective key
-   * on pressing the same key or when playback stops jump to the next file in the folder, until all music is played
+   * read trellis keys (/)
+   * on key press play a music file from the micro SD card from a specific folder and blink the respective key (/)
+   * on pressing the same key or when playback stops jump to the next file in the folder, until all music is played (/)
    * read the rotary decoder to change the volume, the maximum volume can be configured
    * detect when a headphone is plugged in and mute the amplifier for the internal speakers
    * switch the music box off automatically after an idle period
+
+  Todos:
+   - Serial waits for a max. time
+   - Audio off when idle (volume 255,255)
 
   Written by Jörg Keller, Switzerland  
   MIT license, all text above must be included in any redistribution

#define IDLE_WAIT_OFF 3
#define PLAY_SELECTED 4

/*************************************************** 
 * Variables
 ****************************************************/

Adafruit_Trellis trellis = Adafruit_Trellis();
Adafruit_VS1053_FilePlayer player = Adafruit_VS1053_FilePlayer(MUSIC_RESET, MUSIC_CS, MUSIC_DCS, MUSIC_DREQ, CARD_CS);

unsigned long nextReadTick = millis();
unsigned long nextIdleTick = millis();

    }
  }
  if (state == PLAY_SELECTED) {
    int encoderChange = encoder.getValue() * VOLUME_DIRECTION;
    if (encoderChange != 0) {
      volume += encoderChange;
      volume = max(VOLUME_MAX, min(volume, VOLUME_MIN));
      Serial.print("Set Volume "); Serial.println(volume);
      player.setVolume(volume, volume);
    }
    if (player.stopped()) onStop();
  }
  return READ_DELAY;
