1 package org
.usfirst
.frc
.team3501
.robot
;
3 import edu
.wpi
.first
.wpilibj
.Joystick
;
4 import edu
.wpi
.first
.wpilibj
.buttons
.Button
;
7 public static Joystick leftJoystick
;
8 public static Joystick rightJoystick
;
10 // first column of arcade buttons - getting past defenses
11 public static DigitalButton passPortcullis
;
12 public static DigitalButton passChevalDeFrise
;
13 public static DigitalButton passDrawbridge
;
14 public static DigitalButton passSallyPort
;
16 // second column of arcade buttons - different angles for intake arm
17 // TO DO: change position numbers to angle values (?)
18 public static DigitalButton lowerChevalDeFrise
;
19 public static DigitalButton moveToIntakeBoulder
;
20 public static DigitalButton poiseAboveChevalDeFrise
;
21 public static DigitalButton moveIntakeArmInsideRobot
;
23 // left joystick buttons
24 public static Button toggleShooter
;
25 public static Button SpinRobot180_1
; // both do the same thing, just two
26 public static Button SpinRobot180_2
; // different buttons
27 public static Button compactRobot_1
;
28 public static Button compactRobot_2
;
30 // right joystick buttons
31 public static Button intakeBoulder
;
32 public static Button shootBoulder
;
34 // button to change robot to the scaling mode
35 public static DigitalButton toggleScaling
;
38 leftJoystick
= new Joystick(Constants
.OI
.LEFT_STICK_PORT
);
39 rightJoystick
= new Joystick(Constants
.OI
.RIGHT_STICK_PORT
);
41 // passPortcullis = new DigitalButton(
42 // new DigitalInput(Constants.OI.PASS_PORTCULLIS_PORT));
43 // passPortcullis.whenPressed(new PassPortcullis());
45 // passChevalDeFrise = new DigitalButton(
46 // new DigitalInput(Constants.OI.PASS_CHEVAL_DE_FRISE_PORT));
47 // passChevalDeFrise.whenPressed(new PassChevalDeFrise());
49 // passDrawbridge = new DigitalButton(
50 // new DigitalInput(Constants.OI.PASS_DRAWBRIDGE_PORT));
51 // passDrawbridge.whenPressed(new PassDrawBridge());
53 // passSallyPort = new DigitalButton(
54 // new DigitalInput(Constants.OI.PASS_SALLYPORT_PORT));
55 // passSallyPort.whenPressed(new PassSallyPort());
57 // lowerChevalDeFrise = new DigitalButton(
58 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_ONE_PORT));
59 // lowerChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
60 // IntakeArm.potAngles[0], IntakeArm.moveIntakeArmSpeed));
62 // moveToIntakeBoulder = new DigitalButton(
63 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_TWO_PORT));
64 // moveToIntakeBoulder.whenPressed(new MoveIntakeArmToAngle(
65 // IntakeArm.potAngles[1], IntakeArm.moveIntakeArmSpeed));
67 // poiseAboveChevalDeFrise = new DigitalButton(
68 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_THREE_PORT));
69 // poiseAboveChevalDeFrise.whenPressed(new MoveIntakeArmToAngle(
70 // IntakeArm.potAngles[2], IntakeArm.moveIntakeArmSpeed));
72 // moveIntakeArmInsideRobot = new DigitalButton(
73 // new DigitalInput(Constants.OI.ARCADE_INTAKEARM_LEVEL_FOUR_PORT));
74 // moveIntakeArmInsideRobot.whenPressed(new MoveIntakeArmToAngle(
75 // IntakeArm.potAngles[3], IntakeArm.moveIntakeArmSpeed));
77 // toggleShooter = new JoystickButton(leftJoystick,
78 // Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
79 // SpinRobot180_1 = new JoystickButton(leftJoystick,
80 // Constants.OI.SPIN1_PORT);
81 // SpinRobot180_1.whenPressed(new Turn180());
83 // SpinRobot180_2 = new JoystickButton(leftJoystick,
84 // Constants.OI.SPIN2_PORT);
85 // SpinRobot180_2.whenPressed(new Turn180());
87 // compactRobot_1 = new JoystickButton(leftJoystick,
88 // Constants.OI.LEFT_JOYSTICK_TOP_CENTER_PORT);
89 // compactRobot_2 = new JoystickButton(leftJoystick,
90 // Constants.OI.LEFT_JOYSTICK_TOP_LOW_PORT);
92 // intakeBoulder = new JoystickButton(rightJoystick,
93 // Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
94 // shootBoulder = new JoystickButton(rightJoystick,
95 // Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
97 // toggleScaling = new DigitalButton(
98 // new DigitalInput(Constants.OI.TOGGLE_SCALING_PORT));
99 // toggleScaling.whenPressed(new ToggleScaling());
101 // if (!Constants.Scaler.SCALING) {
102 // toggleShooter.toggleWhenPressed(new runShooter());
103 // compactRobot_1.whenPressed(new CompactRobot());
104 // compactRobot_2.whenPressed(new CompactRobot());
106 // intakeBoulder.whenPressed(new IntakeBall());
107 // shootBoulder.whenPressed(new Shoot());
110 // // toggleShooter becomes winch
111 // // compact robot button 1 and 2 retracts the lift
112 // // intake button stops the winch
113 // // shoot button extends the lift
114 // toggleShooter.whenPressed(new RunWinchContinuous(
115 // Constants.Scaler.SCALE_SPEED, Constants.Scaler.SECONDS_TO_SCALE));
116 // compactRobot_1.whenPressed(new RetractLift());
117 // compactRobot_2.whenPressed(new RetractLift());
119 // intakeBoulder.whenReleased(new StopWinch());
120 // shootBoulder.whenPressed(new ExtendLift());