Add Hall Effect Sensor code to test sensor
[3501/2017steamworks] / src / org / usfirst / frc / team3501 / robot / subsystems / Shooter.java
index ba0f51cefbf86e775efeb159feab757f2439eb78..d786d22cf5120e6ff680d6c017256ba8c487bd44 100644 (file)
@@ -1,18 +1,21 @@
 package org.usfirst.frc.team3501.robot.subsystems;
 
 import org.usfirst.frc.team3501.robot.Constants;
+import org.usfirst.frc.team3501.robot.utils.HallEffectSensor;
 
 import com.ctre.CANTalon;
 
 import edu.wpi.first.wpilibj.command.Subsystem;
 
 public class Shooter extends Subsystem {
+  public double wheelP = 0, wheelI = 0, wheelD = -0;
   private static Shooter shooter;
+  private static HallEffectSensor hallEffect;
   private final CANTalon flyWheel, indexWheel;
 
   public static final double DEFAULT_INDEXING_SPEED = 0;
   public static final double DEFAULT_SHOOTING_SPEED = 0;
-  public static double CURRENT_SHOOTING_SPEED;
+  public static double CURRENT_SHOOTING_SPEED = DEFAULT_SHOOTING_SPEED;
 
   public static final double SHOOTING_SPEED_INCREMENT = 0;
 
@@ -20,6 +23,11 @@ public class Shooter extends Subsystem {
     flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL);
     indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL);
 
+    hallEffect = new HallEffectSensor(Constants.Shooter.HALL_EFFECT_PORT, 1);
+  }
+
+  public static HallEffectSensor getHallEffectSensor() {
+    return hallEffect;
   }
 
   /**
@@ -72,4 +80,8 @@ public class Shooter extends Subsystem {
   protected void initDefaultCommand() {
 
   }
+
+  public double getShooterRPM() {
+    return hallEffect.getRPM();
+  }
 }