Recode everything for new robot
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / OI.java
CommitLineData
38a404b3
KZ
1package org.usfirst.frc.team3501.robot;
2
571a0e2a
HD
3import org.usfirst.frc.team3501.robot.commands.driving.SetHighGear;
4import org.usfirst.frc.team3501.robot.commands.driving.SetLowGear;
5import org.usfirst.frc.team3501.robot.commands.driving.ToggleFront;
6import org.usfirst.frc.team3501.robot.commands.intakearm.RunIntake;
7import org.usfirst.frc.team3501.robot.commands.intakearm.StopIntake;
6b06b2bc 8import org.usfirst.frc.team3501.robot.commands.shooter.Shoot;
571a0e2a
HD
9import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
10
37e5a121 11
38a404b3 12import edu.wpi.first.wpilibj.Joystick;
cb3389eb
E
13import edu.wpi.first.wpilibj.buttons.Button;
14import edu.wpi.first.wpilibj.buttons.JoystickButton;
38a404b3
KZ
15
16public class OI {
17 public static Joystick leftJoystick;
18 public static Joystick rightJoystick;
6b06b2bc 19
6b06b2bc 20 // left joystick buttons
571a0e2a 21 public static Button gearTrigger;
6b06b2bc
CZ
22
23 // right joystick buttons
571a0e2a 24 public static Button intakeTrigger;
6b06b2bc 25 public static Button shootBoulder;
571a0e2a 26 public static Button toggleFront;
38a404b3
KZ
27
28 public OI() {
29 leftJoystick = new Joystick(Constants.OI.LEFT_STICK_PORT);
30 rightJoystick = new Joystick(Constants.OI.RIGHT_STICK_PORT);
31
571a0e2a
HD
32 // Left joystick
33 gearTrigger = new JoystickButton(leftJoystick,
6b06b2bc 34 Constants.OI.LEFT_JOYSTICK_TRIGGER_PORT);
571a0e2a
HD
35 gearTrigger.whenPressed(new SetHighGear());
36 gearTrigger.whenReleased(new SetLowGear());
52ef246c 37
571a0e2a
HD
38 // Right joystick
39 intakeTrigger = new JoystickButton(rightJoystick,
6b06b2bc 40 Constants.OI.RIGHT_JOYSTICK_TRIGGER_PORT);
571a0e2a
HD
41 intakeTrigger.whenPressed(new RunIntake());
42 intakeTrigger.whenReleased(new StopIntake());
6b06b2bc 43
571a0e2a
HD
44 shootBoulder = new JoystickButton(rightJoystick,
45 Constants.OI.RIGHT_JOYSTICK_SHOOT_PORT);
46 shootBoulder.whenPressed(new Shoot());
7a949394 47
571a0e2a
HD
48 toggleFront = new JoystickButton(rightJoystick,
49 Constants.OI.RIGHT_JOYSTICK_THUMB_PORT);
50 toggleFront.whenPressed(new ToggleFront());
38a404b3
KZ
51 }
52}