bool inRange(float val, float low, float high){
  return ((low <= val) && (val <= high));
}

float average( float color[], int sizeArray, float newValue, int testNum){
  float average = 0;
  float sum = 0;
  for ( int k = (sizeArray - 1) ; k > 0 ; --k ){
    color[k] = color[k-1];
  }
  color[0] = newValue;
  for ( int k = 0 ; k < sizeArray ; ++k ){
    sum = sum + color[k];
  }
  average = sum / sizeArray;
  return average;
}

void zeroArray(float zero[], int num){
  for ( int k = 0 ; k < num ; ++k ){
    zero[k] = 0;
  }
}

void printArray(int printed[], int num){
  for(int k = 0; k < num ; ++k){
    Serial.print(printed[k]);
    Serial.print(" ");
    if(k == (num - 1)){
      Serial.println(" ");
    }
  }
}

