Skip to content
This repository was archived by the owner on Sep 14, 2019. It is now read-only.

Commit 83cb30f

Browse files
committed
changes to make intake work
1 parent d6bfa17 commit 83cb30f

5 files changed

Lines changed: 20 additions & 18 deletions

File tree

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#Sun Feb 18 11:01:27 PST 2018
2-
C\:\\Users\\dean\\git\\RobotCode2018\\Robot2018\\lib\\libpathfinderjava.so=4087ee38c338446b8305f67716260df4
1+
#Sun Feb 18 17:11:52 PST 2018
2+
C\:\\Users\\Student\\git\\RobotCode2018\\Robot2018\\lib\\libpathfinderjava.so=4087ee38c338446b8305f67716260df4

Robot2018/src/org/usfirst/frc/team199/Robot2018/RobotMap.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,10 @@ public RobotMap() {
130130

131131
leftIntakeMotor = new VictorSP(getPort("IntakeLeftVictorSP", 9));
132132
rightIntakeMotor = new VictorSP(getPort("IntakeRightVictorSP", 8));
133-
// leftIntakeHorizontalSolenoid = new
134-
// DoubleSolenoid(getPort("IntakeLeftHorizontalSolenoidPort1", 2),
135-
// getPort("IntakeLeftHorizontalSolenoidPort2", 3));
136-
// rightIntakeHorizontalSolenoid = new
137-
// DoubleSolenoid(getPort("IntakeRightHorizontalSolenoidPort1", 4),
138-
// getPort("IntakeRightHorizontalSolenoidPort2", 5));
133+
leftIntakeHorizontalSolenoid = new DoubleSolenoid(getPort("IntakeLeftHorizontalSolenoidPort1", 2),
134+
getPort("IntakeLeftHorizontalSolenoidPort2", 3));
135+
rightIntakeHorizontalSolenoid = new DoubleSolenoid(getPort("IntakeRightHorizontalSolenoidPort1", 4),
136+
getPort("IntakeRightHorizontalSolenoidPort2", 5));
139137
// leftIntakeVerticalSolenoid = new
140138
// DoubleSolenoid(getPort("IntakeLeftVerticalSolenoidPort1", 6),
141139
// getPort("IntakeLeftVerticalSolenoidPort2", 7));

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/IntakeCube.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ protected void initialize() {
2020

2121
// Called repeatedly when this Command is scheduled to run
2222
protected void execute() {
23-
Robot.intakeEject.runIntake(1);
23+
Robot.intakeEject.runIntake(-1);
2424
}
2525

2626
// Make this return true when this Command no longer needs to run execute()

Robot2018/src/org/usfirst/frc/team199/Robot2018/commands/OutakeCube.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,28 @@ public OutakeCube() {
2020
// Called just before this Command runs the first time
2121
protected void initialize() {
2222
tim = new Timer();
23+
tim.reset();
24+
tim.start();
2325
}
2426

2527
// Called repeatedly when this Command is scheduled to run
2628
protected void execute() {
27-
Robot.intakeEject.runIntake(-1);
29+
Robot.intakeEject.runIntake(1);
2830
}
2931

3032
// Make this return true when this Command no longer needs to run execute()
3133
protected boolean isFinished() {
32-
return tim.get() > Robot.getConst("Outake Time", 1);
34+
return tim.get() > Robot.getConst("Outake Time", 0.5);
3335
}
3436

3537
// Called once after isFinished returns true
3638
protected void end() {
39+
Robot.intakeEject.runIntake(0);
3740
}
3841

3942
// Called when another command which requires one or more of the same
4043
// subsystems is scheduled to run
4144
protected void interrupted() {
45+
end();
4246
}
4347
}

Robot2018/src/org/usfirst/frc/team199/Robot2018/subsystems/IntakeEject.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ public double getRightIntakeSpeed() {
4848
*
4949
*/
5050
public boolean hasCube() {
51-
return pdp.getCurrent(Robot.rmap.getPort("PDP Intake Left Channel", 4)) > Robot.getConst("Max Current", 38)
52-
&& pdp.getCurrent(Robot.rmap.getPort("PDP Intake Right Channel", 11)) > Robot.getConst("Max Current",
53-
38);
51+
return pdp.getCurrent(Robot.rmap.getPort("PDP Intake Left Channel", 4)) > Robot.getConst("Max Current", 39)
52+
|| pdp.getCurrent(Robot.rmap.getPort("PDP Intake Right Channel", 11)) > Robot.getConst("Max Current",
53+
39);
5454
}
5555

5656
/**
@@ -124,9 +124,9 @@ public void lowerIntake() {
124124
}
125125

126126
/**
127-
* Opens the intake
127+
* Closes the intake
128128
*/
129-
public void openIntake() {
129+
public void closeIntake() {
130130
DoubleSolenoid.Value leftSet = Robot.getBool("Intake Left Horizontal Solenoid Inverted", false)
131131
? DoubleSolenoid.Value.kReverse
132132
: DoubleSolenoid.Value.kForward;
@@ -138,9 +138,9 @@ public void openIntake() {
138138
}
139139

140140
/**
141-
* Closes the intake
141+
* Opens the intake
142142
*/
143-
public void closeIntake() {
143+
public void openIntake() {
144144
DoubleSolenoid.Value leftSet = Robot.getBool("Intake Left Horizontal Solenoid Inverted", false)
145145
? DoubleSolenoid.Value.kForward
146146
: DoubleSolenoid.Value.kReverse;

0 commit comments

Comments
 (0)