X-Git-Url: http://challenge-bot.com/repos/?a=blobdiff_plain;f=src%2Forg%2Fusfirst%2Ffrc%2Fteam3501%2Frobot%2FOI.java;h=07352f8787161fe5f47dcb614322a0e50cde57a0;hb=e1f7a74216c8845966fb0fa03a08dfeb3868ff3e;hp=fdb91263fd289b31569a5b0f69285aed64803b7e;hpb=fab544eb2395a8aa847abc1890bc635e5ba63a7c;p=3501%2Fstronghold-2016 diff --git a/src/org/usfirst/frc/team3501/robot/OI.java b/src/org/usfirst/frc/team3501/robot/OI.java index fdb91263..07352f87 100644 --- a/src/org/usfirst/frc/team3501/robot/OI.java +++ b/src/org/usfirst/frc/team3501/robot/OI.java @@ -3,9 +3,10 @@ package org.usfirst.frc.team3501.robot; import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear; import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear; import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront; +import org.usfirst.frc.team3501.robot.commands.intakearm.MoveIntakeArm; import org.usfirst.frc.team3501.robot.commands.intakearm.RunIntake; -import org.usfirst.frc.team3501.robot.commands.intakearm.StopIntake; -import org.usfirst.frc.team3501.robot.commands.shooter.Shoot; +import org.usfirst.frc.team3501.robot.commands.shooter.FireCatapult; +import org.usfirst.frc.team3501.robot.commands.shooter.ResetCatapult; import edu.wpi.first.wpilibj.Joystick; import edu.wpi.first.wpilibj.buttons.Button; @@ -16,35 +17,74 @@ public class OI { public static Joystick rightJoystick; // left joystick buttons - public static Button gearTrigger; + public static Button gearShift; + public static Button extendIntake1; + public static Button extendIntake2; + public static Button retractIntake1; + public static Button retractIntake2; + public static Button toggleFront; // right joystick buttons - public static Button intakeTrigger; - public static Button shootBoulder; - public static Button toggleFront; + public static Button intake; + public static Button outtake1; + public static Button outtake2; + public static Button shooterUp; + public static Button shooterDown1; + public static Button shooterDown2; public OI() { leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT); rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT); // Left joystick - gearTrigger = new JoystickButton(leftJoystick, - Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT); - gearTrigger.whenPressed(new SetHighGear()); - gearTrigger.whenReleased(new SetLowGear()); + gearShift = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_GEAR_SHIFT_PORT); + gearShift.whenPressed(new SetLowGear()); + gearShift.whenReleased(new SetHighGear()); - // Right joystick - intakeTrigger = new JoystickButton(rightJoystick, - Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT); - intakeTrigger.whenPressed(new RunIntake()); - intakeTrigger.whenReleased(new StopIntake()); + extendIntake1 = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_1_PORT); + extendIntake1.whenPressed(new MoveIntakeArm(Constants.IntakeArm.EXTEND)); - shootBoulder = new JoystickButton(rightJoystick, - Constants.OI.RIGHT_JOYSTICK_SHOOT_PORT); - shootBoulder.whenPressed(new Shoot()); + extendIntake2 = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_EXTEND_INTAKE_2_PORT); + extendIntake2.whenPressed(new MoveIntakeArm(Constants.IntakeArm.EXTEND)); - toggleFront = new JoystickButton(rightJoystick, - Constants.OI.RIGHT_JOYSTICK_THUMB_PORT); + retractIntake1 = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_1_PORT); + retractIntake1.whenPressed(new MoveIntakeArm(Constants.IntakeArm.RETRACT)); + + retractIntake2 = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_RETRACT_INTAKE_2_PORT); + retractIntake2.whenPressed(new MoveIntakeArm(Constants.IntakeArm.RETRACT)); + + toggleFront = new JoystickButton(leftJoystick, + Constants.OI.LEFT_JOYSTICK_TOGGLE_FRONT_PORT); toggleFront.whenPressed(new ToggleFront()); + + // Right joystick + intake = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_INTAKE_PORT); + intake.whenPressed(new RunIntake(Constants.IntakeArm.IN)); + + outtake1 = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_OUTTAKE_1_PORT); + outtake1.whenPressed(new RunIntake(Constants.IntakeArm.OUT)); + + outtake2 = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_OUTTAKE_2_PORT); + outtake2.whenPressed(new RunIntake(Constants.IntakeArm.OUT)); + + shooterUp = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_SHOOTER_UP_PORT); + shooterUp.whenPressed(new FireCatapult()); + + shooterDown1 = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_SHOOTER_DOWN_1_PORT); + shooterDown1.whenPressed(new ResetCatapult()); + + shooterDown2 = new JoystickButton(rightJoystick, + Constants.OI.RIGHT_JOYSTICK_SHOOTER_DOWN_2_PORT); + shooterDown2.whenPressed(new ResetCatapult()); } }