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