1 package org
.usfirst
.frc
.team3501
.robot
.subsystems
;
3 import org
.usfirst
.frc
.team3501
.robot
.Constants
;
5 import edu
.wpi
.first
.wpilibj
.CANTalon
;
6 import edu
.wpi
.first
.wpilibj
.command
.Subsystem
;
9 * The IntakeArm consists of two rollers that are controlled by one motor, with
10 * a potentiometer on it.
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
20 public class IntakeArm
extends Subsystem
{
21 private CANTalon intake
;
22 private CANTalon chevalDeFriseHand
;
25 intake
= new CANTalon(Constants
.IntakeArm
.PORT
);
26 chevalDeFriseHand
= new CANTalon(Constants
.IntakeArm
.CHEVAL_DE_FRISE_HAND_PORT
);
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
34 * Must be used in a command that has a timer variable to stop it.
36 public void dropIntake() {
40 public void intake() {
41 intake
.set(Constants
.IntakeArm
.INTAKE_SPEED
);
44 public void output() {
45 intake
.set(Constants
.IntakeArm
.OUTPUT_SPEED
);
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.
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
59 public void setRollerVoltage(double voltage
) {
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.
68 * @return Returns the voltage of the motor that controls the roller. The
69 * range of the voltage goes from [-1,1].
70 * A negative voltage indicates that the motor is running backwards.
73 public double getRollerVoltage() {
78 * This method checks to see if the presence of the ball inside is true or
81 * @return Returns whether the ball is inside as true or false
84 public boolean isBallInside() {
89 * This method checks to see if the motors controlling the rollers are
92 * @return Returns whether the motors are currently running, and returns the
93 * state of the condition (true or false).
97 public boolean areRollersRolling() {
102 protected void initDefaultCommand() {