Skip to content

Commit

Permalink
Created StopIntake Command
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonisrailov committed Feb 10, 2018
1 parent 9fb8294 commit 92da401
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
39 changes: 39 additions & 0 deletions src/org/usfirst/frc/team4737/robot/commands/StopIntake.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package org.usfirst.frc.team4737.robot.commands;

import org.usfirst.frc.team4737.robot.Robot;

import edu.wpi.first.wpilibj.command.Command;

/**
*
*/
public class StopIntake extends Command {

public StopIntake() {
// Use requires() here to declare subsystem dependencies
requires(Robot.INTAKE);
}

// Called just before this Command runs the first time
protected void initialize() {
}

// Called repeatedly when this Command is scheduled to run
protected void execute() {
Robot.INTAKE.setSpeed(0);
}

// Make this return true when this Command no longer needs to run execute()
protected boolean isFinished() {
return false;
}

// Called once after isFinished returns true
protected void end() {
}

// Called when another command which requires one or more of the same
// subsystems is scheduled to run
protected void interrupted() {
}
}
13 changes: 12 additions & 1 deletion src/org/usfirst/frc/team4737/robot/subsystems/Intake.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.usfirst.frc.team4737.robot.subsystems;

import org.usfirst.frc.team4737.robot.RobotMap;
import org.usfirst.frc.team4737.robot.commands.StopIntake;

import com.ctre.phoenix.motorcontrol.can.WPI_TalonSRX;

Expand Down Expand Up @@ -29,6 +30,16 @@ public Intake() {

public void initDefaultCommand() {
// Set the default command for a subsystem here.
// setDefaultCommand(new MySpecialCommand());
setDefaultCommand(new StopIntake());

}

/**
*
* @param speed
* ranges from -1 to 1.
*/
public void setSpeed(double speed) {
// TODO
}
}

0 comments on commit 92da401

Please sign in to comment.