Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package frc.robot.commands;
- import edu.wpi.first.wpilibj.command.Command;
- import frc.robot.Robot;
- public class RampExtend extends Command {
- private boolean finished = false;
- public RampExtend() {
- // Use requires() here to declare subsystem dependencies
- // eg. requires(chassis);
- requires(Robot.m_rampmotor);
- }
- // Called just before this Command runs the first time
- @Override
- protected void initialize() {
- Robot.m_rampmotor.rampOn(1.0);
- }
- // Called repeatedly when this Command is scheduled to run
- @Override
- protected void execute() {
- if (!Robot.m_rampmotor.extendedSwitch.get()) {
- finished = true;
- }
- }
- // Make this return true when this Command no longer needs to run execute()
- @Override
- protected boolean isFinished() {
- return finished;
- }
- // Called once after isFinished returns true
- @Override
- protected void end() {
- Robot.m_rampmotor.rampOff();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement