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:
dc56d4f
)
Initialize photogate in shooter subsystem
author
niyatisriram
<niyatisriram@gmail.com>
Wed, 17 Feb 2016 19:03:56 +0000
(11:03 -0800)
committer
Kevin Zhang
<icestormf1@gmail.com>
Wed, 17 Feb 2016 20:33:40 +0000
(12:33 -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 99f66213b193728ddf53e4f1927785d979df62e9..80d786762994a72067d56a36d2d4c8ce7d1cb29e 100644
(file)
--- a/
src/org/usfirst/frc/team3501/robot/Robot.java
+++ b/
src/org/usfirst/frc/team3501/robot/Robot.java
@@
-1,7
+1,6
@@
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.Constants.Defense;
package org.usfirst.frc.team3501.robot;
import org.usfirst.frc.team3501.robot.Constants.Defense;
-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;
@@
-23,12
+22,10
@@
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,
- positionFourDefense, positionFiveDefense;
+
positionFourDefense, positionFiveDefense;
@Override
public void robotInit() {
@Override
public void robotInit() {
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 3633c04ca10e2fea9e5c63a656427a86642eaea1..0d9187a441b6a734e4fc0e61ef3d848a7034d16f 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,7
@@
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;
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
public Shooter() {
shooter = new CANTalon(Constants.Shooter.PORT);
@@
-47,7
+49,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) {