generated from OakvilleDynamics/frc-robot-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a subsystem command to activate the dump twice automatically. This is now the default command for the copilot controller. Modified the dump constants to reflect opening and closing of the DoubleSolenoid. Added a Time utility class that can assist in performing actions and also maintain other time functions.
- Loading branch information
1 parent
64e8b3a
commit 3d8afb9
Showing
4 changed files
with
35 additions
and
6 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
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,20 @@ | ||
package frc.robot.util; | ||
|
||
import edu.wpi.first.wpilibj.Timer; | ||
|
||
public class Time { | ||
|
||
/** | ||
* Performs an action then waits for a specified amount of time | ||
* | ||
* @param action The action to perform | ||
* @param delay The delay in seconds | ||
*/ | ||
public static void performThenWait(Runnable action, double delay) { | ||
double timer = Timer.getFPGATimestamp(); | ||
action.run(); | ||
while (Timer.getFPGATimestamp() - timer < delay) { | ||
// Wait for the delay | ||
} | ||
} | ||
} |