@@ -0,0 +1,2346 @@
+package org.team2168.utils;%0A%0Aimport edu.wpi.first.wpilibj.GenericHID;%0Aimport edu.wpi.first.wpilibj.buttons.Button;%0A%0A/**%0A* Trigger commands from an analog input on the joystick%0A*%0A* @author James%0A*/%0Apublic class JoystickAnalogButton extends Button %7B%0A%0A    GenericHID m_joystick;%0A    int m_axisNumber;%0A    private double THRESHOLD = 0.5;%0A%0A    /**%0A     * Create a button for triggering commands off a joystick's analog axis%0A     *%0A     * @param joystick The GenericHID object that has the button (e.g. Joystick,%0A     *                 KinectStick, etc)%0A     * @param axisNumber The axis number%0A     */%0A    public JoystickAnalogButton(GenericHID joystick, int axisNumber) %7B%0A        m_joystick = joystick;%0A        m_axisNumber = axisNumber;%0A    %7D%0A%0A    /**%0A     * Create a button for triggering commands off a joystick's analog axis%0A     *%0A     * @param joystick The GenericHID object that has the button (e.g. Joystick,%0A     *                 KinectStick, etc)%0A     * @param axisNumber The axis number%0A     * @param threshold The threshold to trigger above (positive)%0A     *                  or below (negative)%0A     */%0A    public JoystickAnalogButton(GenericHID joystick, int axisNumber,%0A            double threshold) %7B%0A        m_joystick = joystick;%0A        m_axisNumber = axisNumber;%0A        THRESHOLD = threshold;%0A    %7D%0A%0A    /**%0A     * Set the value above which triggers should occur (for positive thresholds)%0A     * or below which triggers should occur (for negative thresholds)%0A     * The default threshold value is 0.5%0A     *%0A     * @param threshold the threshold value (1 to -1)%0A     */%0A    public void setThreshold(double threshold)%7B%0A        THRESHOLD = threshold;%0A    %7D%0A%0A    /**%0A     * Get the defined threshold value.%0A     * @return the threshold value%0A     */%0A    public double getThreshold()%7B%0A        return THRESHOLD;%0A    %7D%0A%0A    /**%0A     * Get the state of the JoystickAnalogButton.%0A     * @return true when the analog value exceeds the specified threshold.%0A     */%0A    public boolean get() %7B%0A        if(THRESHOLD %3C 0)%7B%0A            //Return true if axis value is less than negative threshold%0A            return m_joystick.getRawAxis(m_axisNumber) %3C THRESHOLD;%0A        %7D else %7B%0A            //Return true if axis value is greater than positive threshold%0A            return m_joystick.getRawAxis(m_axisNumber) %3E THRESHOLD;%0A        %7D%0A    %7D%0A%0A%7D%0A

Create JoystickAnalogButton.java