@@ -0,0 +1,837 @@
+package com.saintsrobotics.frc.utilities;%0A%0A/**%0A * An implementation of a moving/running average.%0A * @author Saints Robotics%0A */%0Apublic class MovingAverage %7B%0A    private final double%5B%5D samples;%0A    private final int size;%0A    %0A    private double total;%0A    private int currentIndex;%0A    %0A    public MovingAverage(int size) %7B%0A        this.size = size;%0A        samples = new double%5Bsize%5D;%0A    %7D%0A    %0A    public double getAverage() %7B%0A        return total / size;%0A    %7D%0A    %0A    public void add(double sample) %7B%0A        // Remove current sample%0A        total -= samples%5BcurrentIndex%5D;%0A        %0A        // Add current sample%0A        samples%5BcurrentIndex%5D = sample;%0A        total += sample;%0A        %0A        // Increment index%0A        currentIndex++;%0A        %0A        if (currentIndex %3E= size) %7B%0A            currentIndex = 0;%0A        %7D%0A    %7D%0A%7D%0A

Add moving average