Implemented stopping the arm using limit switches
This commit is contained in:
parent
da3c1b24d6
commit
94ce2eb3bc
@ -20,6 +20,8 @@ public class Robot extends IterativeRobot {
|
|||||||
SmartDashboard.putBoolean("CompressorEnabled", true);
|
SmartDashboard.putBoolean("CompressorEnabled", true);
|
||||||
//Automatically determine if rolling in or rolling out
|
//Automatically determine if rolling in or rolling out
|
||||||
SmartDashboard.putBoolean("SmartRollers", true);
|
SmartDashboard.putBoolean("SmartRollers", true);
|
||||||
|
//Use the limit swithces on the shooter
|
||||||
|
SmartDashboard.putBoolean("UseLimitSwitches", true);
|
||||||
}
|
}
|
||||||
public void disabledInit() {
|
public void disabledInit() {
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package org.usfirst.frc.team2059.robot.commands.shooter;
|
package org.usfirst.frc.team2059.robot.commands.shooter;
|
||||||
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
import org.usfirst.frc.team2059.robot.commands.CommandBase;
|
||||||
import org.usfirst.frc.team2059.robot.Robot;
|
import org.usfirst.frc.team2059.robot.Robot;
|
||||||
|
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -21,6 +22,11 @@ public class MoveArm extends CommandBase {
|
|||||||
}
|
}
|
||||||
// Make this return true when this Command no longer needs to run execute()
|
// Make this return true when this Command no longer needs to run execute()
|
||||||
protected boolean isFinished() {
|
protected boolean isFinished() {
|
||||||
|
if (SmartDashboard.getBoolean("UseLimitSwitches")) {
|
||||||
|
if (mainArm.getTopPressed() || mainArm.getBottomPressed()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Called once after isFinished returns true
|
// Called once after isFinished returns true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user