Commit | Line | Data |
---|---|---|
7b11350e KZ |
1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
3 | import org.usfirst.frc.team3501.robot.Constants; | |
4 | ||
6fd4f44e | 5 | import edu.wpi.first.wpilibj.AnalogPotentiometer; |
7b11350e KZ |
6 | import edu.wpi.first.wpilibj.CANTalon; |
7 | import 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 | 21 | public 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 | */ | |
38 | public void dropIntake() { | |
28a012b6 | 39 | intakeRoller.set(0.3); |
7b11350e KZ |
40 | } |
41 | ||
42 | public void intake() { | |
28a012b6 | 43 | intakeRoller.set(Constants.IntakeArm.INTAKE_SPEED); |
7b11350e KZ |
44 | } |
45 | ||
46 | public void output() { | |
28a012b6 | 47 | intakeRoller.set(Constants.IntakeArm.OUTPUT_SPEED); |
7b11350e KZ |
48 | } |
49 | ||
fdde5248 | 50 | /*** |
add57fee YA |
51 | * This method allows you to set the voltage of the motor. The range of |
52 | * voltage is from [-1, 1]. A negative voltage makes the motor run backwards. | |
5e330e78 | 53 | * |
add57fee YA |
54 | * @param voltage |
55 | * The voltage of the motors that control the rollers. The range of | |
56 | * these motors go from [-1,1]. A negative voltage makes the motor | |
57 | * run | |
58 | * backwards. | |
fdde5248 YA |
59 | */ |
60 | ||
add57fee | 61 | public void setRollerVoltage(double voltage) { |
fdde5248 YA |
62 | |
63 | } | |
64 | ||
65 | /*** | |
5e330e78 SC |
66 | * This method gets you the current voltage of the motor that controls the |
67 | * intake arm. The range of voltage is from [-1,1]. | |
68 | * A negative voltage makes the motor run backwards. | |
add57fee YA |
69 | * |
70 | * @return Returns the voltage of the motor that controls the roller. The | |
5e330e78 SC |
71 | * range of the voltage goes from [-1,1]. |
72 | * A negative voltage indicates that the motor is running backwards. | |
fdde5248 YA |
73 | */ |
74 | ||
add57fee | 75 | public double getRollerVoltage() { |
fdde5248 YA |
76 | return 0; |
77 | } | |
78 | ||
79 | /*** | |
92adc9db SC |
80 | * This method checks to see if the presence of the ball inside is true or |
81 | * false. | |
fdde5248 | 82 | * |
92adc9db | 83 | * @return Returns whether the ball is inside as true or false |
8e57685f KZ |
84 | */ |
85 | ||
86 | public boolean isBallInside() { | |
87 | return true; | |
88 | } | |
89 | ||
90 | /*** | |
f8856d62 SC |
91 | * This method checks to see if the motors controlling the rollers are |
92 | * currently running. | |
0e37d53e YA |
93 | * |
94 | * @return Returns whether the motors are currently running, and returns the | |
95 | * state of the condition (true or false). | |
1eb84222 | 96 | * |
fdde5248 YA |
97 | */ |
98 | ||
99 | public boolean areRollersRolling() { | |
100 | return true; | |
101 | } | |
102 | ||
6fd4f44e SC |
103 | /*** |
104 | * This method gets the angle of the potentiometer on the Intake Arm. | |
105 | * | |
106 | * @return angle of potentiometer | |
107 | */ | |
108 | public double getIntakePot() { | |
109 | return intakePot.get(); | |
110 | } | |
111 | ||
7b11350e KZ |
112 | @Override |
113 | protected void initDefaultCommand() { | |
114 | ||
115 | } | |
116 | } |