projects
/
3501
/
stronghold-2016
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ef0cfbf
)
Initialize photogate in shooter subsystem
author
niyatisriram
<niyatisriram@gmail.com>
Wed, 17 Feb 2016 19:03:56 +0000
(11:03 -0800)
committer
niyatisriram
<niyatisriram@gmail.com>
Wed, 17 Feb 2016 19:03:56 +0000
(11:03 -0800)
src/org/usfirst/frc/team3501/robot/Robot.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/sensors/Photogate.java
patch
|
blob
|
blame
|
history
src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
patch
|
blob
|
blame
|
history
diff --git
a/src/org/usfirst/frc/team3501/robot/Robot.java
b/src/org/usfirst/frc/team3501/robot/Robot.java
index 905844120d2bba3ebfbae9ace7670b060c4b0a83..8fd099fb2999081e999638cb08d2e46b9872297f 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Robot.java
+++ b/
src/org/usfirst/frc/team3501/robot/Robot.java
@@
-2,7
+2,6
@@
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.Constants.Defense;
import org.usfirst.frc.team3501.robot.sensors.GyroLib;
import org.usfirst.frc.team3501.robot.Constants.Defense;
import org.usfirst.frc.team3501.robot.sensors.GyroLib;
-import org.usfirst.frc.team3501.robot.sensors.Photogate;
import org.usfirst.frc.team3501.robot.subsystems.DefenseArm;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
import org.usfirst.frc.team3501.robot.subsystems.DefenseArm;
import org.usfirst.frc.team3501.robot.subsystems.DriveTrain;
import org.usfirst.frc.team3501.robot.subsystems.IntakeArm;
@@
-25,8
+24,6
@@
public class Robot extends IterativeRobot {
public static IntakeArm intakeArm;
public static DefenseArm defenseArm;
public static IntakeArm intakeArm;
public static DefenseArm defenseArm;
- public static Photogate photogate;
-
// Sendable Choosers send a drop down menu to the Smart Dashboard.
SendableChooser positionChooser;
SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
// Sendable Choosers send a drop down menu to the Smart Dashboard.
SendableChooser positionChooser;
SendableChooser positionOneDefense, positionTwoDefense, positionThreeDefense,
diff --git
a/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java
b/src/org/usfirst/frc/team3501/robot/sensors/Photogate.java
index b1d003988e908fd038a1d1c27453014612f0602e..c9f3d642fdabf1a74af6caee467d918ae3518aef 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/sensors/Photogate.java
+++ b/
src/org/usfirst/frc/team3501/robot/sensors/Photogate.java
@@
-2,9
+2,6
@@
package org.usfirst.frc.team3501.robot.sensors;
import edu.wpi.first.wpilibj.AnalogInput;
import edu.wpi.first.wpilibj.AnalogInput;
-// TODO: Change certain reactions based on testing, ie what value(s) return true
-// and what value(s) return false.
-
/***
* The photogate is a pair of IR LED and phototransistor sensor that uses a
* reflective method to sense the presence of the boulder within the robot's
/***
* The photogate is a pair of IR LED and phototransistor sensor that uses a
* reflective method to sense the presence of the boulder within the robot's
@@
-44,7
+41,7
@@
public class Photogate extends AnalogInput {
/***
* @param threshold
/***
* @param threshold
- * (range [0, 4095]
+ * (range [0, 4095]
)
*/
public void setThreshold(int threshold) {
this.threshold = threshold;
*/
public void setThreshold(int threshold) {
this.threshold = threshold;
diff --git
a/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
b/src/org/usfirst/frc/team3501/robot/subsystems/Shooter.java
index bcce7bcdc2df74ff7de1491ff96cb5dc12d97b51..60452a0c9080bfe4bf61beb2c129ce0be2b37717 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;
@@
-25,6
+26,7
@@
public class Shooter extends Subsystem {
private DoubleSolenoid hood, punch;
private Encoder encoder;
private Lidar lidar;
private DoubleSolenoid hood, punch;
private Encoder encoder;
private Lidar lidar;
+ private Photogate photogate;
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
@@
-45,7
+47,7
@@
public class Shooter extends Subsystem {
*/
public boolean isBallInside() {
*/
public boolean isBallInside() {
- return
true
;
+ return
photogate.isBallPresent()
;
}
public void setSpeed(double speed) {
}
public void setSpeed(double speed) {