Skip to content

Commit

Permalink
Added RunIntake and ReverseIntake commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonisrailov committed Feb 10, 2018
1 parent 10f26f3 commit f8eef54
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/org/usfirst/frc/team4737/robot/commands/ReverseIntake.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 ReverseIntake extends Command {

public ReverseIntake() {
// 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(-1);
}

// 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() {
}
}
39 changes: 39 additions & 0 deletions src/org/usfirst/frc/team4737/robot/commands/RunIntake.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 RunIntake extends Command {

public RunIntake() {
// 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(1);
}

// 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() {
}
}

0 comments on commit f8eef54

Please sign in to comment.