mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-24 01:31:46 +00:00
Adds a RobotPeriodic method to IterativeRobot (#226)
Called globally during each IterativeRobot loop
This commit is contained in:
committed by
Peter Johnson
parent
4fc7daedc9
commit
f271185cbc
@@ -220,6 +220,20 @@ void IterativeRobot::TestInit() {
|
||||
std::printf("Default %s() method... Overload me!\n", __FUNCTION__);
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodic code for all modes should go here.
|
||||
*
|
||||
* Users should override this method for code which will be called periodically
|
||||
* at a regular rate while the robot is in any mode.
|
||||
*/
|
||||
void IterativeRobot::RobotPeriodic() {
|
||||
static bool firstRun = true;
|
||||
if (firstRun) {
|
||||
std::printf("Default %s() method... Overload me!\n", __FUNCTION__);
|
||||
firstRun = false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Periodic code for disabled mode should go here.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user