delete setRollerVoltage method, add javadoc style comment for intakeBall and outputBa...
[3501/stronghold-2016] / src / org / usfirst / frc / team3501 / robot / subsystems / IntakeArm.java
CommitLineData
7b11350e
KZ
1package org.usfirst.frc.team3501.robot.subsystems;
2
3import org.usfirst.frc.team3501.robot.Constants;
4
6fd4f44e 5import edu.wpi.first.wpilibj.AnalogPotentiometer;
7b11350e
KZ
6import edu.wpi.first.wpilibj.CANTalon;
7import edu.wpi.first.wpilibj.command.Subsystem;
8
add57fee 9/***
1eb84222
SC
10 * The IntakeArm consists of two rollers that are controlled by one motor, with
11 * a potentiometer on it.
add57fee
YA
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
7b11350e 21public class IntakeArm extends Subsystem {
28a012b6
SC
22 private CANTalon intakeRoller;
23 private CANTalon intakeArm;
6fd4f44e 24 private AnalogPotentiometer intakePot;
7b11350e
KZ
25
26 public IntakeArm() {
28a012b6
SC
27 intakeRoller = new CANTalon(Constants.IntakeArm.PORT);
28 intakeArm = new CANTalon(Constants.IntakeArm.CHEVAL_DE_FRISE_HAND_PORT);
7b11350e
KZ
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.
fdde5248 35 *
7b11350e
KZ
36 * Must be used in a command that has a timer variable to stop it.
37 */
7b11350e 38
a8329166
SC
39 /***
40 * These two methods (intakeBall and outputBall)sets the voltage of the motor.
41 * The voltage values are constants in Constants class
42 */
4c82a9f5 43 public void intakeBall() {
28a012b6 44 intakeRoller.set(Constants.IntakeArm.INTAKE_SPEED);
7b11350e
KZ
45 }
46
4c82a9f5 47 public void outputBall() {
28a012b6 48 intakeRoller.set(Constants.IntakeArm.OUTPUT_SPEED);
7b11350e
KZ
49 }
50
fdde5248 51 /***
5e330e78
SC
52 * This method gets you the current voltage of the motor that controls the
53 * intake arm. The range of voltage is from [-1,1].
54 * A negative voltage makes the motor run backwards.
add57fee
YA
55 *
56 * @return Returns the voltage of the motor that controls the roller. The
5e330e78
SC
57 * range of the voltage goes from [-1,1].
58 * A negative voltage indicates that the motor is running backwards.
fdde5248
YA
59 */
60
add57fee 61 public double getRollerVoltage() {
a8329166 62 return intakeRoller.get();
fdde5248
YA
63 }
64
65 /***
92adc9db
SC
66 * This method checks to see if the presence of the ball inside is true or
67 * false.
fdde5248 68 *
92adc9db 69 * @return Returns whether the ball is inside as true or false
8e57685f
KZ
70 */
71
72 public boolean isBallInside() {
73 return true;
74 }
75
76 /***
f8856d62
SC
77 * This method checks to see if the motors controlling the rollers are
78 * currently running.
0e37d53e
YA
79 *
80 * @return Returns whether the motors are currently running, and returns the
81 * state of the condition (true or false).
1eb84222 82 *
fdde5248
YA
83 */
84
85 public boolean areRollersRolling() {
86 return true;
87 }
88
6fd4f44e
SC
89 /***
90 * This method gets the angle of the potentiometer on the Intake Arm.
4c82a9f5 91 *
6fd4f44e
SC
92 * @return angle of potentiometer
93 */
94 public double getIntakePot() {
95 return intakePot.get();
96 }
97
7b11350e
KZ
98 @Override
99 protected void initDefaultCommand() {
100
101 }
102}