projects
/
3501
/
stronghold-2016
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix merge conflicts
[3501/stronghold-2016]
/
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 3633c04ca10e2fea9e5c63a656427a86642eaea1..6e0c7acfb443a9106e46ed27d0c40e985732ebf4 100755
(executable)
--- a/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
+++ b/
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
@@
-2,6
+2,7
@@
package org.usfirst.frc.team3501.robot.subsystems;
import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.sensors.Lidar;
import org.usfirst.frc.team3501.robot.Constants;
import org.usfirst.frc.team3501.robot.sensors.Lidar;
+import org.usfirst.frc.team3501.robot.sensors.Photogate;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
import edu.wpi.first.wpilibj.CANTalon;
import edu.wpi.first.wpilibj.CounterBase.EncodingType;
@@
-24,6
+25,8
@@
public class Shooter extends Subsystem {
private DoubleSolenoid hood1, hood2, punch;
private Encoder encoder;
private Lidar lidar;
private DoubleSolenoid hood1, hood2, punch;
private Encoder encoder;
private Lidar lidar;
+ private Photogate photogate;
+ private boolean usePhotoGate;
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
@@
-36,6
+39,7
@@
public class Shooter extends Subsystem {
encoder = new Encoder(Constants.Shooter.ENCODER_PORT_A,
Constants.Shooter.ENCODER_PORT_B, false, EncodingType.k4X);
encoder = new Encoder(Constants.Shooter.ENCODER_PORT_A,
Constants.Shooter.ENCODER_PORT_B, false, EncodingType.k4X);
+ usePhotoGate = true;
}
/***
}
/***
@@
-47,7
+51,12
@@
public class Shooter extends Subsystem {
*/
public boolean isBallInside() {
*/
public boolean isBallInside() {
- return true;
+
+ if (usePhotogate())
+ return photogate.isBallPresent();
+ else
+ return true;
+
}
public void setSpeed(double speed) {
}
public void setSpeed(double speed) {
@@
-111,6
+120,14
@@
public class Shooter extends Subsystem {
return false;
}
return false;
}
+ public boolean usePhotogate() {
+ return this.usePhotoGate;
+ }
+
+ public void togglePhotoGate() {
+ this.usePhotoGate = !this.usePhotoGate;
+ }
+
@Override
protected void initDefaultCommand() {
}
@Override
protected void initDefaultCommand() {
}