@@ -0,0 +1,2406 @@
+package com.thegongoliers.hardware;%0A%0Aimport com.thegongoliers.math.ExponentialMovingAverage;%0Aimport com.thegongoliers.output.PID;%0Aimport edu.wpi.first.wpilibj.Encoder;%0Aimport edu.wpi.first.wpilibj.SpeedController;%0A%0A/**%0A * Created by Kyle on 7/9/2017.%0A */%0Apublic class Motor %7B%0A%0A    private Encoder encoder;%0A    private SpeedController speedController;%0A    private PID pidController;%0A    private ExponentialMovingAverage ema;%0A%0A    /**%0A     * Creates a motor which is monitored by an encoder.%0A     *%0A     * @param speedController The speed controller for the motor.%0A     * @param encoder         The encoder on the motor shaft. The encoder distance per pulse should be set to 1 / pulses per revolution.%0A     * @param pidController   The PID controller for closed loop feedback.%0A     */%0A    public Motor(SpeedController speedController, Encoder encoder, PID pidController) %7B%0A        this.encoder = encoder;%0A        this.speedController = speedController;%0A        this.pidController = pidController;%0A        ema = new ExponentialMovingAverage(10);%0A    %7D%0A%0A    /**%0A     * Creates a motor which is monitored by an encoder.%0A     *%0A     * @param speedController The speed controller for the motor.%0A     * @param encoder         The encoder on the motor shaft. The encoder distance per pulse should be set to 1 / pulses per revolution.%0A     */%0A    public Motor(SpeedController speedController, Encoder encoder) %7B%0A        this(speedController, encoder, new PID(0.25, 0, 0.01, 0.01));%0A    %7D%0A%0A    /**%0A     * Set the throttle of the motor.%0A     *%0A     * @param throttle The throttle of the motor from -100 to 100 percent inclusive, where -100 is full reverse.%0A     */%0A    public void setThrottle(double throttle) %7B%0A        speedController.set(-throttle / 100.0);%0A    %7D%0A%0A    /**%0A     * Get the throttle of the motor.%0A     *%0A     * @return The throttle of the motor from -100 to 100 percent inclusive, where -100 is full reverse.%0A     */%0A    public double getThrottle() %7B%0A        return speedController.get() * -100.0;%0A    %7D%0A%0A    /**%0A     * Set the RPM of the motor.%0A     *%0A     * @param rpm The rpm of the motor.%0A     */%0A    public void setRPM(double rpm) %7B%0A        speedController.set(pidController.getOutput(getRPM(), rpm));%0A    %7D%0A%0A    /**%0A     * Get the RPM of the motor.%0A     *%0A     * @return The RPM of the motor.%0A     */%0A    public double getRPM() %7B%0A        return ema.calculate(encoder.getRate() * 60.0);%0A    %7D%0A%0A%0A%7D%0A

Add motor class