Commit | Line | Data |
---|---|---|
b449387d LH |
1 | package org.usfirst.frc.team3501.robot; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.commands.*; | |
4 | ||
5 | public class OI { | |
f24c549d | 6 | private Joystick left, right; |
b449387d LH |
7 | |
8 | public OI() { | |
9 | left = new Joystick(RobotMap.LEFT_JOYSTICK_PORT); | |
10 | right = new Joystick(RobotMap.RIGHT_JOYSTICK_PORT); | |
11 | ||
12 | right.whenPressed(1, new CloseClaw()); | |
13 | right.whenReleased(1, new OpenClaw()); | |
510cff21 | 14 | |
d24e8611 LH |
15 | right.whenPressed(2, new ToggleClaw()); |
16 | ||
510cff21 LH |
17 | right.whenPressed(11, new TurnOffCompressor()); |
18 | right.whenPressed(12, new TurnOffCompressor()); | |
19 | ||
20 | right.whenPressed(7, new TurnOnCompressor()); | |
21 | right.whenPressed(8, new TurnOnCompressor()); | |
d24e8611 LH |
22 | |
23 | // potential bug point: this should "Just Work" because as soon as | |
24 | // command stops running, left stick pos at 0 should take over... | |
25 | // if that is not the case, arm will continue indefinitely. | |
26 | left.whileHeld(7, new TensionLeftWinch(RobotMap.ARM_ADJUST_SPEED)); | |
27 | left.whileHeld(6, new TensionLeftWinch(-RobotMap.ARM_ADJUST_SPEED)); | |
28 | left.whileHeld(11, new TensionRightWinch(RobotMap.ARM_ADJUST_SPEED)); | |
29 | left.whileHeld(10, new TensionRightWinch(-RobotMap.ARM_ADJUST_SPEED)); | |
b449387d LH |
30 | } |
31 | ||
f24c549d LH |
32 | public double getForwardL() { |
33 | return left.getY(); | |
34 | } | |
35 | ||
36 | public double getForwardR() { | |
b449387d LH |
37 | return right.getY(); |
38 | } | |
39 | ||
f24c549d | 40 | public double getTwistR() { |
b449387d LH |
41 | return right.getTwist(); |
42 | } | |
43 | } |