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