 // to enable the low battery warning with light and voice uncomment the follwing line
 //#define LOWBAT 1
 
-// to use NDEF to get the album directory (as opposed to the trackDb) uncomment the following line
-// ONLY ONE of the below and this line can be chosen
+// to enable the operations light on the front of the box, uncomment the following line
+#define OPRLIGHT 1
+// to enable time based operations light - turns off the light after 30 Minutes - uncomment the following line
+//#define OPRLIGHTTIME 1
+
+// Define the NFC <-> Album implementation
+// ONLY ONE of the these two options can be chosen
+// to use NDEF to get the album directory uncomment the following line
 #define NFCNDEF 1
-
 // to use the Adafruit NFC library to get the Tag UID and retrieve the directory from the trackDb 
-// uncomment the following line. ONLY ONE of the above and this line can be chosen
+// uncomment the following line. 
 //#define NFCTRACKDB 1
+
+// uncomment the next line to enable resuming the last played album on switch on
+// this is achieved via a special file on the SD card and works without a tag but uses the pause/resume button instead
+//#define RESUMELAST 1
 
 //
 // include SPI and SD libraries

  
  // set the buttons as input
  #ifdef VOLUMEPOT
  pinMode(volPotPin, INPUT);       // connects to the potentiometer that shall control the volume
  #endif
  #ifdef BUTTONS
  pinMode(btnLinePin, INPUT);      // connects to the 4 buttons with different resistors (set the value down in function playTrack())
  #endif
  #ifdef LOWBAT
  pinMode(lowBatPin, INPUT);     // connects to the LBO pin of the Adafruit PowerBoost 1000c
  #endif
  #ifdef IRREMOTE
  pinMode(iRRemotePin, INPUT);     // connects to the output port of the remote control (decoded values for each button in function playTrack())
  #endif
  
  // and the leds as output
  pinMode(infoLedPin, OUTPUT);     // connect to blue LED
  pinMode(warnLedPin, OUTPUT);     // connect to orange LED
  pinMode(errorLedPin, OUTPUT);    // connect to a red LED


//
// stores the file to play in the global var filename - it is created from the gloal vars plrCurrentFolder and current track
static boolean setFileNameToPlay(byte trackNo) {
  // convert the trackNo to a char array - we need it next to create the filename of the track
  char curTrackCharNumber[4];
  sprintf(curTrackCharNumber, "%03d", trackNo);
  
  // create the filename of the track to play, including path, so we can feed it to the music player
  strcpy(filename, "");
  strcat(filename, "/");
  strcat(filename, plrCurrentFolder);
  strcat(filename, "/");
  strcat(filename, "track");
  strcat(filename, curTrackCharNumber);
  strcat(filename, ".mp3");
  
  // return true or false for the filename created - this is checked
  return (SD.exists(filename));
}


// store uid, plrCurrentFolder and firstTrackToPlay in the char array trackDbEntry[]
// so we may write it to the track Db file
#ifdef NFCTRACKDB
static void setTrackDbEntry() {
