   //check result, see readme for error codes.
   }
 
-#if (0)
+  #if (0)
   // Typically not used by most shields, hence commented out.
   //Serial.println(F("Applying ADMixer patch."));
   if(MP3player.ADMixerLoad("admxster.053") == 0) {
     //Serial.println(F("Setting ADMixer Volume."));
     MP3player.ADMixerVol(-3);
   }
-#endif
+  #endif
 
 void loop()
 {
+  ///////////////////////////////////////// BLUETOOTH
+  // listen for a response from the HC-05 and write it to the serial monitor
+  if (BT.available()){
+    c = BT.read();
+    Serial.write(c);
+  }
+  // listen for user input and send it to the HC-05
+  if (Serial.available()){
+    c = Serial.read();
+    Serial.write(c);
+    BT.write(c);
+  }
+  ///////////////////////////////////////// END BLUETOOTH
+  
   if (digitalRead(A0)==HIGH)
-{
-  int reading = digitalRead(in);
-
-
-if ((millis() - lastStateChangeTime) > dialHasFinishedRotatingAfterMs) {
-// the dial isn't being dialed, or has just finished being dialed.
-if (needToPrint) {
-// if it's only just finished being dialed, we need to send the number down the serial
-// line and reset the count. We mod the count by 10 because '0' will send 10 pulses.
-
-if(count==1){
-  MP3player.stopTrack();
-  Serial.println("Dail 1-9 to select one track.");
-  Serial.println();
-}
-  
-  else{
-   Serial.print("You select track: ");
-   Serial.println(count-1);
-   Serial.println("The music is playing");
-   MP3player.stopTrack();
-   MP3player.playTrack(count-1);
-   Serial.println();
-   Serial.println("Hey,you can add some sound effect!");
-   Serial.println();
-  }
-
-
-needToPrint = 0;
-count = 0;
-cleared = 0;
-}
+  {
+    int reading = digitalRead(in);
+  
+  
+    if ((millis() - lastStateChangeTime) > dialHasFinishedRotatingAfterMs) {
+    // the dial isn't being dialed, or has just finished being dialed.
+      if (needToPrint) {
+      // if it's only just finished being dialed, we need to send the number down the serial
+      // line and reset the count. We mod the count by 10 because '0' will send 10 pulses.
+      
+      if(count==1){
+        MP3player.stopTrack();
+        Serial.println("Dail 1-9 to select one track.");
+        Serial.println();
+      }
+        
+      else{
+        Serial.print("You select track: ");
+        Serial.println(count-1);
+        Serial.println("The music is playing");
+        MP3player.stopTrack();
+        MP3player.playTrack(count-1);
+        Serial.println();
+        Serial.println("Hey,you can add some sound effect!");
+        Serial.println();
+      }
+    
+    
+      needToPrint = 0;
+      count = 0;
+      cleared = 0;
+      }
+    } 
+  
+    if (reading != lastState) {
+      lastStateChangeTime = millis();
+    }
+      if ((millis() - lastStateChangeTime) > debounceDelay) {
+      // debounce - this happens once it's stablized
+        if (reading != trueState) {
+        // this means that the switch has either just gone from closed->open or vice versa.
+        trueState = reading;
+          if (trueState == HIGH) {
+          // increment the count of pulses if it's gone high.
+          count++; 
+          needToPrint = 1; // we'll need to print this number (once the dial has finished rotating)
+          } 
+        }
+      }
+      lastState = reading;
+  }
+  else {
+    MP3player.stopTrack();
+  }
 } 
 
-if (reading != lastState) {
-lastStateChangeTime = millis();
-}
-if ((millis() - lastStateChangeTime) > debounceDelay) {
-// debounce - this happens once it's stablized
-if (reading != trueState) {
-// this means that the switch has either just gone from closed->open or vice versa.
-trueState = reading;
-if (trueState == HIGH) {
-// increment the count of pulses if it's gone high.
-count++; 
-needToPrint = 1; // we'll need to print this number (once the dial has finished rotating)
-} 
-}
-}
-lastState = reading;
-}
-else
-{
-MP3player.stopTrack();
-}
-} 
-

  Serial.println();
  Serial.println();

  //Initialize the SdCard.
  if(!sd.begin(SD_SEL, SPI_FULL_SPEED)) sd.initErrorHalt();
  // depending upon your SdCard environment, SPI_HAVE_SPEED may work better.

 * \ref Error_Codes
 */
  char buffer[6]; // 0-35K+null


//////////////// BLUETOOTH
#define bt_power 7
#define bt_key_power 8
#define indication_led 13

#include <SoftwareSerial.h>
SoftwareSerial BT(3, 2); // RX | TX

char c = ' ';
//////////////// END BLUETOOTH


// constants
