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

//  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;

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

void setup()
{
