A window average, averages data over a specified range. The range in this case is 100 readings or numReadings. The totalOUT is all the points in the array for the output current sensor. The last value in the array is subtracted from the total. The current sensor is read again, then the new reading is added to the total points in the array. The index value is then incremented to properly move the array forward by one place. Then the total points are divided by the number of readings in order to determine the windowed averaged output current, and the process repeats itself.