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