1
|
|
|
package org.usfirst.frc.team3695.robot;
|
2
|
|
|
|
3
|
|
|
import org.usfirst.frc.team3695.robot.commands.ButtonCommandClamp;
|
4
|
|
|
import org.usfirst.frc.team3695.robot.commands.ButtonCommandEat;
|
5
|
|
|
import org.usfirst.frc.team3695.robot.commands.ButtonCommandKillCompressor;
|
6
|
|
|
import org.usfirst.frc.team3695.robot.commands.ButtonCommandSpit;
|
7
|
|
|
import org.usfirst.frc.team3695.robot.enumeration.Direction;
|
8
|
|
|
import org.usfirst.frc.team3695.robot.util.Xbox;
|
9
|
|
|
|
10
|
|
|
import edu.wpi.first.wpilibj.Joystick;
|
11
|
|
|
import edu.wpi.first.wpilibj.buttons.Button;
|
12
|
|
|
import edu.wpi.first.wpilibj.buttons.JoystickButton;
|
13
|
|
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
14
|
|
|
|
15
|
|
|
/** the output/input setup */
|
16
|
|
|
public class OI {
|
17
|
|
|
|
18
|
|
|
public static final Joystick DRIVER = new Joystick(0);
|
19
|
|
|
public static final Joystick OPERATOR = new Joystick(1);
|
20
|
|
|
|
21
|
|
|
/**
|
22
|
|
|
* assigns what every SmartDash and controller button does
|
23
|
|
|
*
|
24
|
|
|
* ye() gets called at teleop enable, assigning button values to controller input
|
25
|
|
|
* still in ye(), below controller value assigns, place each SmartDash button
|
26
|
|
|
* */
|
27
|
|
|
public OI() {
|
|
|
|
|
28
|
|
|
/// manipulator wheels
|
29
|
|
|
Button spinIn = new JoystickButton(OPERATOR, Xbox.LB);
|
30
|
|
|
spinIn.whileHeld(new ButtonCommandEat());
|
31
|
|
|
Button spinOut = new JoystickButton(OPERATOR, Xbox.RB);
|
32
|
|
|
spinOut.whileHeld(new ButtonCommandSpit());
|
33
|
|
|
/// manipulator clamp
|
34
|
|
|
Button toggleClamp = new JoystickButton(OPERATOR, Xbox.RB);
|
35
|
|
|
toggleClamp.toggleWhenActive(new ButtonCommandClamp());
|
36
|
|
|
/// To Compress, or Not To Compress. It is now an option.
|
37
|
|
|
SmartDashboard.putData("Disable Compressor", new ButtonCommandKillCompressor());
|
38
|
|
|
}
|
39
|
|
|
|
40
|
|
|
} |