-
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.
Start more OOP approach to codriver controls
- Loading branch information
Showing
7 changed files
with
62 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
public class Climber {} |
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,3 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
public class Intake {} |
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,23 @@ | ||
package frc.robot.RobotComponents; | ||
|
||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
import frc.robot.auton.AutonShooterFeed; | ||
|
||
public class Shooter { | ||
|
||
public void startShooterMotors() { | ||
Robot.motors.getLeftFlywheel().setVelocity(Constants.SHOOTING_VELOCITY); | ||
Robot.motors.getRightFlywheel().setVelocity(Constants.SHOOTING_VELOCITY); | ||
} | ||
|
||
public void stopShooterMotors() { | ||
Robot.motors.getLeftFlywheel().stopMotor(); | ||
Robot.motors.getRightFlywheel().stopMotor(); | ||
} | ||
|
||
public void startFeedMotors() { | ||
Robot.getTeleopActionRunner().removeActionsOfType(AutonShooterFeed.class); | ||
Robot.getTeleopActionRunner().addActionToRun(new AutonShooterFeed()); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package frc.robot.auton; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
import frc.robot.Constants; | ||
import frc.robot.Robot; | ||
|
||
public class AutonShooterFeed extends AutonAction { | ||
|
||
private double revFinishedTime; | ||
|
||
@Override | ||
public boolean isDone() { | ||
return Timer.getFPGATimestamp() > revFinishedTime; | ||
} | ||
|
||
@Override | ||
public void initiate() { | ||
Robot.motors.getFeeder().set(0.75); | ||
revFinishedTime = Timer.getFPGATimestamp() + Constants.FEEDER_MOTOR_SHUTOFF_TIME; | ||
} | ||
|
||
@Override | ||
public void shutdown() { | ||
Robot.motors.getFeeder().stopMotor(); | ||
} | ||
} |