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

//  NOTE: The larger NUM_SAMPLES, the smoother the values, but also
//  the longer it will take the average to move in response to you turning the
//  potentiometer
const int NUM_SAMPLES = 10;
int potSamples[NUM_SAMPLES];
int potIndex = 0;
int totalPotValue = 0;

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

