   Serial.println(lastAveragePotValue);
   
   // Delay
-  delay(50);
+  delay(10);
 }
 

//  update the pot value sent out from the arduino if the pot value
//  has changed by a specified amount
int lastAveragePotValue = 0;
int changeThreshold = 2;

void setup()
{

  
  // Detect whether the new average pot value has changed enough
  // from our last saved average pot value
  int change = abs(averagePotValue-lastAveragePotValue);
  if (change >= CHANGE_THRESHOLD){
    lastAveragePotValue = averagePotValue;
  }
  
