change intake and output method names to intakeBall and outputBall
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / IntakeArm.java
1 package org.usfirst.frc.team3501.robot.subsystems;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4
5 import edu.wpi.first.wpilibj.AnalogPotentiometer;
6 import edu.wpi.first.wpilibj.CANTalon;
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 /***
10 * The IntakeArm consists of two rollers that are controlled by one motor, with
11 * a potentiometer on it.
12 *
13 * The motor controls the rollers, making them roll forwards and backwards.
14 * The Intake rollers are on the back of the robot. As the rollers run, they
15 * intake the ball.
16 *
17 * @author superuser
18 *
19 */
20
21 public class IntakeArm extends Subsystem {
22 private CANTalon intakeRoller;
23 private CANTalon intakeArm;
24 private AnalogPotentiometer intakePot;
25
26 public IntakeArm() {
27 intakeRoller = new CANTalon(Constants.IntakeArm.PORT);
28 intakeArm = new CANTalon(Constants.IntakeArm.CHEVAL_DE_FRISE_HAND_PORT);
29 }
30
31 /*
32 * Intake only moves once at the beginning of the match. It lowers at the
33 * beginning of the match and is held there by mechanical stops until the end
34 * of the match.
35 *
36 * Must be used in a command that has a timer variable to stop it.
37 */
38
39 public void intakeBall() {
40 intakeRoller.set(Constants.IntakeArm.INTAKE_SPEED);
41 }
42
43 public void outputBall() {
44 intakeRoller.set(Constants.IntakeArm.OUTPUT_SPEED);
45 }
46
47 /***
48 * This method allows you to set the voltage of the motor. The range of
49 * voltage is from [-1, 1]. A negative voltage makes the motor run backwards.
50 *
51 * @param voltage
52 * The voltage of the motors that control the rollers. The range of
53 * these motors go from [-1,1]. A negative voltage makes the motor
54 * run
55 * backwards.
56 */
57
58 public void setRollerVoltage(double voltage) {
59
60 }
61
62 /***
63 * This method gets you the current voltage of the motor that controls the
64 * intake arm. The range of voltage is from [-1,1].
65 * A negative voltage makes the motor run backwards.
66 *
67 * @return Returns the voltage of the motor that controls the roller. The
68 * range of the voltage goes from [-1,1].
69 * A negative voltage indicates that the motor is running backwards.
70 */
71
72 public double getRollerVoltage() {
73 return 0;
74 }
75
76 /***
77 * This method checks to see if the presence of the ball inside is true or
78 * false.
79 *
80 * @return Returns whether the ball is inside as true or false
81 */
82
83 public boolean isBallInside() {
84 return true;
85 }
86
87 /***
88 * This method checks to see if the motors controlling the rollers are
89 * currently running.
90 *
91 * @return Returns whether the motors are currently running, and returns the
92 * state of the condition (true or false).
93 *
94 */
95
96 public boolean areRollersRolling() {
97 return true;
98 }
99
100 /***
101 * This method gets the angle of the potentiometer on the Intake Arm.
102 *
103 * @return angle of potentiometer
104 */
105 public double getIntakePot() {
106 return intakePot.get();
107 }
108
109 @Override
110 protected void initDefaultCommand() {
111
112 }
113 }