I wrote code for incrreasing and decreasing shooting speed and added necessary consta...
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
CommitLineData
79ba119a 1package org.usfirst.frc.team3501.robot.subsystems;
2
04227dc0 3import org.usfirst.frc.team3501.robot.Constants;
4
5import com.ctre.CANTalon;
6
7import edu.wpi.first.wpilibj.command.Subsystem;
8
9public class Shooter extends Subsystem {
079a8cb6 10 private static Shooter shooter;
04227dc0 11 private final CANTalon flyWheel, indexWheel;
79ba119a 12
ad7e6b1e
NA
13 public static final double DEFAULT_SHOOTING_SPEED = 0;
14 public static double CURRENT_SHOOTING_SPEED;
15
16 public static final double SHOOTING_SPEED_INCREMENT = 0;
17
079a8cb6 18 private Shooter() {
04227dc0 19 flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL);
20 indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL);
ad7e6b1e 21
079a8cb6 22 }
41dfad94 23
04227dc0 24 /**
25 * Returns shooter object
26 *
27 * @return Shooter object
28 */
079a8cb6
CZ
29 public static Shooter getShooter() {
30 if (shooter == null) {
31 shooter = new Shooter();
32 }
33 return shooter;
34 }
41dfad94 35
079a8cb6 36 /**
04227dc0 37 * Sets fly wheel motor value to input.
38 *
39 * @param val
40 * motor value from -1 to 1(fastest forward)
079a8cb6 41 */
04227dc0 42 public void setFlyWheelMotorVal(final double val) {
43 flyWheel.set(val);
079a8cb6 44 }
41dfad94 45
04227dc0 46 /**
47 * Stops fly wheel motor.
48 */
49 public void stopFlyWheel() {
50 flyWheel.set(0);
51 }
41dfad94 52
04227dc0 53 /**
54 * Sets index wheel motor value to input.
55 *
56 * @param val
57 * motor value from -1 to 1(fastest forward)
58 */
59 public void setIndexWheelMotorVal(final double val) {
60 indexWheel.set(val);
079a8cb6 61 }
41dfad94 62
079a8cb6 63 /**
04227dc0 64 * Stops index wheel motor.
079a8cb6
CZ
65 */
66 public void stopIndexWheel() {
04227dc0 67 indexWheel.set(0);
079a8cb6 68 }
41dfad94 69
04227dc0 70 @Override
71 protected void initDefaultCommand() {
079a8cb6
CZ
72
73 }
79ba119a 74}