de5dc6f4a76cd76cba81515a74fe5f9794619499
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Intake.java
1 package org.usfirst.frc.team3501.robot.subsystems;
2
3 import org.usfirst.frc.team3501.robot.Constants;
4
5 import com.ctre.CANTalon;
6
7 import edu.wpi.first.wpilibj.command.Subsystem;
8
9 /**
10 * @author Meeta
11 */
12 public class Intake extends Subsystem {
13 public static Intake intake = null;
14 private CANTalon intakeWheel;
15 public static final double INTAKE_SPEED = 0;
16
17 public Intake() {
18 intakeWheel = new CANTalon(Constants.Intake.INTAKE_ROLLER_PORT);
19 }
20
21 /***
22 * It gets the intake instance, and if intake has not been initialized, then
23 * it will be initialized.
24 *
25 * @returns intake
26 */
27 public static Intake getIntake() {
28 if (intake == null) {
29 intake = new Intake();
30 }
31 return intake;
32 }
33
34 @Override
35 protected void initDefaultCommand() {
36
37 }
38
39 /***
40 * Sets speed of intake wheel to input speed
41 *
42 * @param speed
43 * from -1 to 1
44 */
45 public void setSpeed(double speed) {
46 intakeWheel.set(speed);
47 }
48
49 }