  *    >>> START recording by having potentiometer turned above half-way
  *    >>> STOP recording by having potentiometer turned below half-way
  * 
- * Assumes use of Teensy 3.6 and Tympan Rev A or C
+ * Assumes Tympan Rev C or D.  Program in Arduino IDE as a Teensy 3.6.
  * 
  * Uses super-fast SD library that is originall from Greiman, but which
  *    has been forked, made compatible with the Teensy Audio library, and
  *    included as part of the Tympan Library.
  * 
  * Created: Chip Audette, OpenAudio, March 2018
+ *  Jun 2018: updated for Tympan RevC or RevD
+ *  Jun 2018: updated to adde automatic mic detection
  * 
  * License: MIT License, Use At Your Own Risk
  */

  //has enough time passed to update everything?
  if (curTime_millis < lastUpdate_millis) lastUpdate_millis = 0; //handle wrap-around of the clock
  if ((curTime_millis - lastUpdate_millis) > updatePeriod_millis) { //is it time to update the user interface?
      potentiometer_value = ((float32_t)analogRead(POT_PIN)) / 1024.0;
  
      lastUpdate_millis = curTime_millis;
  } // end if
} //end servicePotentiometer();


//This routine prints the current and maximum CPU usage and the current usage of the AudioMemory that has been allocated
void printCPUandMemory(unsigned long curTime_millis, unsigned long updatePeriod_millis) {
  //static unsigned long updatePeriod_millis = 3000; //how many milliseconds between updating gain reading?
  static unsigned long lastUpdate_millis = 0;

  //has enough time passed to update everything?

      if (my_SD_writer.open(fname)) {
        Serial.print("Opened "); Serial.print(fname); Serial.println(" on SD for writing.");
        queueLeft.begin(); queueRight.begin();
        audioHardware.setRedLED(LOW); audioHardware.setAmberLED(HIGH); //Turn ON the Amber LED
      } else {
        Serial.print("Failed to open "); Serial.print(fname); Serial.println(" on SD for writing.");
      }
