| 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 | public class Shooter extends Subsystem { |
| 10 | private static Shooter shooter; |
| 11 | private final CANTalon flyWheel, indexWheel; |
| 12 | |
| 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 | |
| 18 | private Shooter() { |
| 19 | flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL); |
| 20 | indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL); |
| 21 | |
| 22 | } |
| 23 | |
| 24 | /** |
| 25 | * Returns shooter object |
| 26 | * |
| 27 | * @return Shooter object |
| 28 | */ |
| 29 | public static Shooter getShooter() { |
| 30 | if (shooter == null) { |
| 31 | shooter = new Shooter(); |
| 32 | } |
| 33 | return shooter; |
| 34 | } |
| 35 | |
| 36 | /** |
| 37 | * Sets fly wheel motor value to input. |
| 38 | * |
| 39 | * @param val |
| 40 | * motor value from -1 to 1(fastest forward) |
| 41 | */ |
| 42 | public void setFlyWheelMotorVal(final double val) { |
| 43 | flyWheel.set(val); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * Stops fly wheel motor. |
| 48 | */ |
| 49 | public void stopFlyWheel() { |
| 50 | flyWheel.set(0); |
| 51 | } |
| 52 | |
| 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); |
| 61 | } |
| 62 | |
| 63 | /** |
| 64 | * Stops index wheel motor. |
| 65 | */ |
| 66 | public void stopIndexWheel() { |
| 67 | indexWheel.set(0); |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | protected void initDefaultCommand() { |
| 72 | |
| 73 | } |
| 74 | } |