worked on commands
authorTrevor <tr89on@gmail.com>
Sat, 28 Jan 2017 02:44:37 +0000 (18:44 -0800)
committerTrevor <tr89on@gmail.com>
Sat, 28 Jan 2017 02:44:37 +0000 (18:44 -0800)
src/org/usfirst/frc/team3501/robot/OI.java

index 935c4c6e32eb4da8fb3dbc5590e4f51bfef6aea5..92169fe89424c64724d283b165a8b8fc1e807ad5 100644 (file)
@@ -1,5 +1,14 @@
 package org.usfirst.frc.team3501.robot;
 
+import org.usfirst.frc.team3501.robot.commandgroups.PrepareToShoot;
+import org.usfirst.frc.team3501.robot.commandgroups.Shoot;
+import org.usfirst.frc.team3501.robot.commands.driving.ToggleGear;
+import org.usfirst.frc.team3501.robot.commands.driving.Turn90Left;
+import org.usfirst.frc.team3501.robot.commands.driving.Turn90Right;
+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 edu.wpi.first.wpilibj.Joystick;
 import edu.wpi.first.wpilibj.buttons.Button;
 import edu.wpi.first.wpilibj.buttons.JoystickButton;
@@ -8,12 +17,23 @@ public class OI {
   private static OI oi;
   public static Joystick leftJoystick;
   public static Joystick rightJoystick;
-  public static Button toggleWinch;
 
+  public static Button toggleWinch;
   public static Button toggleIndexWheel;
   public static Button toggleFlyWheel;
+  public static Button toggleIntake;
+  public static Button toggleReverseIntake;
+  public static Button toggleHighGear;
+  public static Button toggleNormalGear;
+  public static Button increaseShootSpeed;
+  public static Button decreaseShootSpeed;
+  public static Button turn90Right;
+  public static Button turn90Left;
+  public static Button readyShooter;
+  public static Button shootButton;
 
   public 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,
@@ -22,6 +42,36 @@ public class OI {
         Constants.OI.TOGGLE_INDEXWHEEL_PORT);
     toggleFlyWheel = new JoystickButton(leftJoystick,
         Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    toggleIntake = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    toggleReverseIntake = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    toggleHighGear = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    toggleNormalGear = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    increaseShootSpeed = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    decreaseShootSpeed = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    turn90Right = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    turn90Left = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    readyShooter = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+    shootButton = new JoystickButton(leftJoystick,
+        Constants.OI.TOGGLE_FLYWHEEL_PORT);
+
+    toggleIndexWheel.whenPressed(new RunIndexWheelContinuous(1));
+    toggleHighGear.whenPressed(new ToggleGear());
+    toggleNormalGear.whenPressed(new ToggleGear());
+    increaseShootSpeed.whenPressed(new IncreaseShootingSpeed());
+    decreaseShootSpeed.whenPressed(new DecreaseShootingSpeed());
+    turn90Right.whenPressed(new Turn90Right());
+    turn90Left.whenPressed(new Turn90Left());
+    readyShooter.whenPressed(new PrepareToShoot());
+    shootButton.whenPressed(new Shoot());
   }
 
   public static OI getOI() {