Added all of the main joystick buttons and connected them with commands
authorTrevor <tr89on@gmail.com>
Sat, 28 Jan 2017 04:22:57 +0000 (20:22 -0800)
committerTrevor <tr89on@gmail.com>
Tue, 31 Jan 2017 03:13:50 +0000 (19:13 -0800)
src/org/usfirst/frc/team3501/robot/Constants.java
src/org/usfirst/frc/team3501/robot/OI.java

index 41480162702a76a35b59c0ce2f37f317fe910431..31a8e31aaf862fd41cf3c6a105709e4c573943c5 100644 (file)
@@ -10,17 +10,21 @@ public class Constants {
   public static class OI {
     public final static int LEFT_STICK_PORT = 0;
     public final static int RIGHT_STICK_PORT = 1;
-    public final static int RIGHT_BUTTON_2 = 0;
-    public final static int RIGHT_BUTTON_3 = 0;
-    public final static int RIGHT_BUTTON_4 = 0;
-    public final static int RIGHT_BUTTON_5 = 0;
+    public final static int RIGHT_BUTTON_1 = 1;
+    public final static int RIGHT_BUTTON_2 = 2;
+    public final static int RIGHT_BUTTON_3 = 3;
+    public final static int RIGHT_BUTTON_4 = 4;
+    public final static int RIGHT_BUTTON_5 = 5;
+    public final static int RIGHT_BUTTON_6 = 6;
+    public final static int LEFT_BUTTON_1 = 1;
     public final static int LEFT_BUTTON_2 = 2;
-    public final static int LEFT_BUTTON_3 = 0;
-    public final static int LEFT_BUTTON_4 = 0;
-    public final static int LEFT_BUTTON_5 = 0;
-    public final static int LEFT_BUTTON_6 = 0;
+    public final static int LEFT_BUTTON_3 = 3;
+    public final static int LEFT_BUTTON_4 = 4;
+    public final static int LEFT_BUTTON_5 = 5;
+    public final static int LEFT_BUTTON_6 = 6;
     public final static int LEFT_TRIGGER_BUTTON = 0;
     public final static int RIGHT_TRIGGER_BUTTON = 0;
+    public final static int RIGHT_LOWER_TRIGGER = 0;
   }
 
   public static class Shooter {
index 28df5994eff988bfa74d53f54526a4b798ac1571..3679b64df8be76c9774d9b6ff243153fd6cead65 100644 (file)
@@ -12,6 +12,7 @@ import org.usfirst.frc.team3501.robot.commands.intake.StopIntake;
 import org.usfirst.frc.team3501.robot.commands.shooter.DecreaseShootingSpeed;
 import org.usfirst.frc.team3501.robot.commands.shooter.IncreaseShootingSpeed;
 import org.usfirst.frc.team3501.robot.commands.shooter.RunIndexWheelContinuous;
+import org.usfirst.frc.team3501.robot.commands.shooter.StopIndexWheel;
 
 import edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
@@ -45,24 +46,32 @@ public class OI {
     System.out.println("OI is open");
     leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
     rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
-    toggleWinch = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
+
+    shootButton = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_TRIGGER_BUTTON);
+    toggleWinch = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_BUTTON_1);
+    readyShooter = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_BUTTON_2);
+    increaseShootSpeed = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_BUTTON_5);
+    decreaseShootSpeed = new JoystickButton(rightJoystick,
+        Constants.OI.RIGHT_BUTTON_6);
+
+    toggleIntake = new JoystickButton(leftJoystick,
+        Constants.OI.LEFT_TRIGGER_BUTTON);
+    toggleGearSpeed = new JoystickButton(leftJoystick,
+        Constants.OI.LEFT_BUTTON_2);
     toggleIndexWheel = new JoystickButton(leftJoystick,
         Constants.OI.LEFT_BUTTON_2);
     toggleFlyWheel = new JoystickButton(leftJoystick,
         Constants.OI.LEFT_BUTTON_2);
-    toggleIntake = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
+    // toggleIntake = new JoystickButton(leftJoystick,
+    // Constants.OI.LEFT_BUTTON_3);
     toggleReverseIntake = new JoystickButton(leftJoystick,
-        Constants.OI.LEFT_BUTTON_2);
-    toggleGearSpeed = new JoystickButton(leftJoystick,
-        Constants.OI.LEFT_BUTTON_2);
-    increaseShootSpeed = new JoystickButton(leftJoystick,
-        Constants.OI.LEFT_BUTTON_2);
-    decreaseShootSpeed = new JoystickButton(leftJoystick,
-        Constants.OI.LEFT_BUTTON_2);
-    turn90Right = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
-    turn90Left = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
-    readyShooter = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
-    shootButton = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_2);
+        Constants.OI.LEFT_BUTTON_4);
+    turn90Right = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_5);
+    turn90Left = new JoystickButton(leftJoystick, Constants.OI.LEFT_BUTTON_6);
 
     toggleWinch.whenActive(new RunWinchContinuous(1));
     // toggleWinch.whenReleased(new KeepWinchInPlace());
@@ -83,7 +92,8 @@ public class OI {
     turn90Left.whenPressed(new Turn90Left());
 
     readyShooter.whenPressed(new PrepareToShoot());
-    shootButton.whenPressed(new Shoot());
+    shootButton.whenActive(new Shoot());
+    shootButton.whenReleased(new StopIndexWheel());
   }
 
   public static OI getOI() {