projects
/
3501
/
2017steamworks
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add Hall Effect Sensor code to test sensor
[3501/2017steamworks]
/
src
/
org
/
usfirst
/
frc
/
team3501
/
robot
/
subsystems
/
Shooter.java
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
index 150ce5091a27713f73a63b970f06ee1274daa138..d786d22cf5120e6ff680d6c017256ba8c487bd44 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
@@
-1,6
+1,7
@@
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
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 com.ctre.CANTalon;
@@
-9,6
+10,7
@@
import edu.wpi.first.wpilibj.command.Subsystem;
public class Shooter extends Subsystem {
public double wheelP = 0, wheelI = 0, wheelD = -0;
private static Shooter shooter;
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;
private final CANTalon flyWheel, indexWheel;
public static final double DEFAULT_INDEXING_SPEED = 0;
@@
-21,6
+23,11
@@
public class Shooter extends Subsystem {
flyWheel = new CANTalon(Constants.Shooter.FLY_WHEEL);
indexWheel = new CANTalon(Constants.Shooter.INDEX_WHEEL);
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;
}
/**
}
/**
@@
-74,7
+81,7
@@
public class Shooter extends Subsystem {
}
}
- public double getShooter
Speed
() {
- return
0.0
;
+ public double getShooter
RPM
() {
+ return
hallEffect.getRPM()
;
}
}
}
}