     Serial.println();
   }
 
+
+
+
+  interrupts();
   //read from serial port
   if ( Serial.available() )
   {

      ble_write(Serial.read());
  }


  //read from button
  int newBtnState = digitalRead(BTN_PIN);
  if( newBtnState != buttonState ) {

    //send button state along BLE
    buttonState = newBtnState;
    String sendCommand = "BTN " + String(buttonState);
    for( int i = 0; i < sendCommand.length(); i++ ) {
      ble_write( sendCommand[i] );
    }

    // update button state when button is pressed
    if(buttonState==1) {
      strobeMode += 1;

      //reset strobeMode if it's greater than 3
      if(strobeMode > 3) {
        strobeMode = 0;
      }
    }
  }

  //read from pot
  int newPotVal = analogRead(POT_PIN);
  if( newPotVal != potVal ) {

unsigned char buf[16] = {0};
unsigned char len = 0;
String command;
volatile int buttonState = 0;
int potVal = 0;
bool lightOn = LOW;
volatile int strobeMode = 0;
int buttonHold = 0;

int delayVals[4] = {0,300,200,100};




void strobeTheLight() {

  //send button state along BLE
  buttonState = digitalRead(BTN_PIN);
  String sendCommand = "BTN " + String(buttonState);
  for( int i = 0; i < sendCommand.length(); i++ ) {
    ble_write( sendCommand[i] );
  }

  // update button state when button is pressed
  if(buttonState==1) {
    strobeMode += 1;

    //reset strobeMode if it's greater than 3
    if(strobeMode > 3) {
      strobeMode = 0;
    }
  }
  else {
    // buttonState = 0
  }
 
}


bool waiting = false;
unsigned long TimerA;

void loop()
{
  noInterrupts();
  if(buttonState==1) {
    buttonHold += 1;

    if(buttonHold > 60) {
      String songCommand = "BTN HOLD ";
      for( int i = 0; i < songCommand.length(); i++ ) {
        ble_write( songCommand[i] );
      }

      buttonHold = 0;
    }
  }
  else {
    buttonHold = 0;
  }

  //read from bluetooth low energy
  if ( ble_available() )
  {
