       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 ) {


Servo myservo;

const int BTN_PIN = 4;
const int LED_PIN = 3;
const int SERVO_PIN = 6; 
const int POT_PIN = A0;

void setup()
{  
  // Default pins set to 9 and 8 for REQN and RDYN
  // Set your REQN and RDYN here before ble_begin() if you need
  //ble_set_pins(3, 2);
  
  // Set your BLE Shield name here, max. length 10
  ble_set_name("The Dopest");

  

  pinMode(BTN_PIN,INPUT);
  pinMode(LED_PIN,OUTPUT);
  pinMode(POT_PIN, INPUT);
  digitalWrite( LED_PIN, LOW );

  myservo.attach(SERVO_PIN);
  


  // determine strobe mode
  if(lightOn) {
    if( !waiting ) {
      //turn LED off
      digitalWrite(LED_PIN,LOW);
      analogWrite(LED_PIN, 0);
      waiting = true;
      TimerA = millis();
    }
    else if(millis()-TimerA > delayVals[strobeMode]){
      //wait a certain amount of time
      waiting = false;
      
      //turn LED back on
      digitalWrite(LED_PIN,HIGH);
      int newBrightness = potVal/4;
      analogWrite(LED_PIN, newBrightness);
    }
  }

  delay(10);
  
  
  ble_do_events();

//  interrupts();
  
}

