     }
   }
 
+  //read from pot
+  int newPotVal = analogRead(POT_PIN);
+  if( newPotVal != potVal ) {
+    
+    potVal = newPotVal;
+    int newBrightness = potVal/4;
+    analogWrite(LED_PIN, newBrightness);
+    String sendCommand = "POT " + String(potVal);
+    for( int i = 0; i < sendCommand.length(); i++ ) {
+      ble_write( sendCommand[i] );
+    }
+  }
+
   delay(10);
   
 

  

  pinMode(BTN_PIN,INPUT);

  pinMode(LED_PIN,OUTPUT);
  digitalWrite( LED_PIN, LOW );
  
  // Init. and start BLE library.
  ble_begin();
  
  // Enable serial debug
  Serial.begin(57600);
}

#include <RBL_nRF8001.h>

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

void setup()
{  
