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