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