-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
111 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
src/main/java/frc/robot/commands/DriveClimberBackwards.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */ | ||
/* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
/* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
/* the project. */ | ||
/*----------------------------------------------------------------------------*/ | ||
|
||
package frc.robot.commands; | ||
|
||
public class DriveClimberBackwards extends CommandBase { | ||
public DriveClimberBackwards() { | ||
super("driveclimberforward"); | ||
// Use requires() here to declare subsystem dependencies | ||
requires(climber); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
@Override | ||
protected void initialize() { | ||
System.out.println("Driving climber backwards"); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
@Override | ||
protected void execute() { | ||
climber.driveBack(-0.5); | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
|
||
// Called once after isFinished returns true | ||
@Override | ||
protected void end() { | ||
System.out.println("done driving the climber backwards"); | ||
climber.driveBack(0); | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
@Override | ||
protected void interrupted() { | ||
System.out.println("climber backwards drive interrupt"); | ||
climber.driveBack(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/*----------------------------------------------------------------------------*/ | ||
/* Copyright (c) 2018 FIRST. All Rights Reserved. */ | ||
/* Open Source Software - may be modified and shared by FRC teams. The code */ | ||
/* must be accompanied by the FIRST BSD license file in the root directory of */ | ||
/* the project. */ | ||
/*----------------------------------------------------------------------------*/ | ||
|
||
package frc.robot.commands; | ||
|
||
public class DriveClimberForward extends CommandBase { | ||
public DriveClimberForward() { | ||
super("driveclimberforward"); | ||
// Use requires() here to declare subsystem dependencies | ||
requires(climber); | ||
} | ||
|
||
// Called just before this Command runs the first time | ||
@Override | ||
protected void initialize() { | ||
System.out.println("Driving climber forward"); | ||
} | ||
|
||
// Called repeatedly when this Command is scheduled to run | ||
@Override | ||
protected void execute() { | ||
climber.driveBack(0.5); | ||
} | ||
|
||
// Make this return true when this Command no longer needs to run execute() | ||
@Override | ||
public boolean isFinished() { | ||
return false; | ||
} | ||
|
||
// Called once after isFinished returns true | ||
@Override | ||
protected void end() { | ||
System.out.println("done driving the climber forwards"); | ||
climber.driveBack(0); | ||
} | ||
|
||
// Called when another command which requires one or more of the same | ||
// subsystems is scheduled to run | ||
@Override | ||
protected void interrupted() { | ||
System.out.println("climber forward drive interrupted"); | ||
climber.driveBack(0); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters