add buttons and commands for testing
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / OI.java
1 package org.usfirst.frc.team3501.robot;
2
3 import org.usfirst.frc.team3501.robot.commands.shooter.Test1;
4 import org.usfirst.frc.team3501.robot.commands.shooter.Test2;
5 import org.usfirst.frc.team3501.robot.commands.shooter.Test3;
6 import org.usfirst.frc.team3501.robot.commands.shooter.Test4;
7
8 import edu.wpi.first.wpilibj.Joystick;
9 import edu.wpi.first.wpilibj.buttons.Button;
10 import edu.wpi.first.wpilibj.buttons.JoystickButton;
11
12 public class OI {
13 public static Joystick leftJoystick;
14 public static Joystick rightJoystick;
15 public static Button test1;
16 public static Button test2;
17 public static Button test3;
18 public static Button test4;
19
20 // // first column of arcade buttons - getting past defenses
21 // public static DigitalButton passPortcullis;
22 // public static DigitalButton passChevalDeFrise;
23 // public static DigitalButton passDrawbridge;
24 // public static DigitalButton passSallyPort;
25 //
26 // // second column of arcade buttons - different angles for intake arm
27 // // TO DO: change position numbers to angle values (?)
28 // public static DigitalButton lowerChevalDeFrise;
29 // public static DigitalButton moveToIntakeBoulder;
30 // public static DigitalButton poiseAboveChevalDeFrise;
31 // public static DigitalButton moveIntakeArmInsideRobot;
32 //
33 // // left joystick buttons
34 // public static Button toggleShooter;
35 // public static Button SpinRobot180_1; // both do the same thing, just two
36 // public static Button SpinRobot180_2; // different buttons
37 // public static Button compactRobot_1;
38 // public static Button compactRobot_2;
39 //
40 // // right joystick buttons
41 // public static Button intakeBoulder;
42 // public static Button shootBoulder;
43 //
44 // // button to change robot to the scaling mode
45 // public static DigitalButton toggleScaling;
46
47 public OI() {
48 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
49 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
50
51 test1 = new JoystickButton(leftJoystick,
52 Constants.OI.SPIN1_PORT);
53 test1.whenPressed(new Test1());
54
55 test2 = new JoystickButton(leftJoystick,
56 Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
57 test2.whenPressed(new Test2());
58
59 test3 = new JoystickButton(leftJoystick,
60 Constants.OI.SPIN2_PORT);
61 test3.whenPressed(new Test3());
62
63 test4 = new JoystickButton(leftJoystick,
64 Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
65 test4.whenPressed(new Test4());
66
67 // passPortcullis = new DigitalButton(
68 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
69 // passPortcullis.whenPressed(new PassPortcullis());
70 //
71 // passChevalDeFrise = new DigitalButton(
72 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
73 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
74 //
75 // passDrawbridge = new DigitalButton(
76 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
77 // passDrawbridge.whenPressed(new PassDrawBridge());
78 //
79 // passSallyPort = new DigitalButton(
80 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
81 // passSallyPort.whenPressed(new PassSallyPort());
82 //
83 // lowerChevalDeFrise = new DigitalButton(
84 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT));
85 // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
86 // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed));
87 //
88 // moveToIntakeBoulder = new DigitalButton(
89 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT));
90 // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle(
91 // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed));
92 //
93 // poiseAboveChevalDeFrise = new DigitalButton(
94 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT));
95 // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
96 // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed));
97 //
98 // moveIntakeArmInsideRobot = new DigitalButton(
99 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT));
100 // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle(
101 // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed));
102 //
103 // toggleShooter = new JoystickButton(leftJoystick,
104 // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
105 // SpinRobot180_1 = new JoystickButton(leftJoystick,
106 // Constants.OI.SPIN1_PORT);
107 // SpinRobot180_1.whenPressed(new Turn180());
108 //
109 // SpinRobot180_2 = new JoystickButton(leftJoystick,
110 // Constants.OI.SPIN2_PORT);
111 // SpinRobot180_2.whenPressed(new Turn180());
112 //
113 // compactRobot_1 = new JoystickButton(leftJoystick,
114 // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
115 // compactRobot_2 = new JoystickButton(leftJoystick,
116 // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
117 //
118 // intakeBoulder = new JoystickButton(rightJoystick,
119 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
120 // shootBoulder = new JoystickButton(rightJoystick,
121 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
122 //
123 // toggleScaling = new DigitalButton(
124 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
125 // toggleScaling.whenPressed(new ToggleScaling());
126 //
127 // if (!Constants.Scaler.SCALING) {
128 // toggleShooter.toggleWhenPressed(new runShooter());
129 // compactRobot_1.whenPressed(new CompactRobot());
130 // compactRobot_2.whenPressed(new CompactRobot());
131 //
132 // intakeBoulder.whenPressed(new IntakeBall());
133 // shootBoulder.whenPressed(new Shoot());
134 //
135 // } else {
136 // // toggleShooter becomes winch
137 // // compact robot button 1 and 2 retracts the lift
138 // // intake button stops the winch
139 // // shoot button extends the lift
140 // toggleShooter.whenPressed(new RunWinchContinuous(
141 // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE));
142 // compactRobot_1.whenPressed(new RetractLift());
143 // compactRobot_2.whenPressed(new RetractLift());
144 //
145 // intakeBoulder.whenReleased(new StopWinch());
146 // shootBoulder.whenPressed(new ExtendLift());
147 // }
148 }
149 }