Commit | Line | Data |
---|---|---|
79ba119a | 1 | package org.usfirst.frc.team3501.robot.subsystems; |
2 | ||
04227dc0 | 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 { | |
079a8cb6 | 10 | private static Shooter shooter; |
04227dc0 | 11 | private final CANTalon flyWheel, indexWheel; |
79ba119a | 12 | |
00f515a1 | 13 | public static final double DEFAULT_INDEXING_SPEED = 0; |
ad7e6b1e NA |
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 | ||
079a8cb6 | 19 | private Shooter() { |
04227dc0 | 20 | flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL); |
21 | indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL); | |
ad7e6b1e | 22 | |
079a8cb6 | 23 | } |
41dfad94 | 24 | |
04227dc0 | 25 | /** |
26 | * Returns shooter object | |
27 | * | |
28 | * @return Shooter object | |
29 | */ | |
079a8cb6 CZ |
30 | public static Shooter getShooter() { |
31 | if (shooter == null) { | |
32 | shooter = new Shooter(); | |
33 | } | |
34 | return shooter; | |
35 | } | |
41dfad94 | 36 | |
079a8cb6 | 37 | /** |
04227dc0 | 38 | * Sets fly wheel motor value to input. |
39 | * | |
40 | * @param val | |
41 | * motor value from -1 to 1(fastest forward) | |
079a8cb6 | 42 | */ |
04227dc0 | 43 | public void setFlyWheelMotorVal(final double val) { |
44 | flyWheel.set(val); | |
079a8cb6 | 45 | } |
41dfad94 | 46 | |
04227dc0 | 47 | /** |
48 | * Stops fly wheel motor. | |
49 | */ | |
50 | public void stopFlyWheel() { | |
51 | flyWheel.set(0); | |
52 | } | |
41dfad94 | 53 | |
04227dc0 | 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); | |
079a8cb6 | 62 | } |
41dfad94 | 63 | |
079a8cb6 | 64 | /** |
04227dc0 | 65 | * Stops index wheel motor. |
079a8cb6 CZ |
66 | */ |
67 | public void stopIndexWheel() { | |
04227dc0 | 68 | indexWheel.set(0); |
079a8cb6 | 69 | } |
41dfad94 | 70 | |
04227dc0 | 71 | @Override |
72 | protected void initDefaultCommand() { | |
079a8cb6 CZ |
73 | |
74 | } | |
79ba119a | 75 | } |