mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
committed by
Peter Johnson
parent
120ceb3427
commit
5ca00dddbe
@@ -21,7 +21,7 @@ import edu.wpi.first.wpilibj.hal.HAL;
|
||||
public class TimedRobot extends IterativeRobotBase {
|
||||
public static final double DEFAULT_PERIOD = 0.02;
|
||||
|
||||
private double m_period = DEFAULT_PERIOD;
|
||||
private volatile double m_period = DEFAULT_PERIOD;
|
||||
|
||||
// Prevents loop from starting if user calls setPeriod() in robotInit()
|
||||
private boolean m_startLoop = false;
|
||||
@@ -68,4 +68,11 @@ public class TimedRobot extends IterativeRobotBase {
|
||||
m_loop.startPeriodic(m_period);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get time period between calls to Periodic() functions.
|
||||
*/
|
||||
public double getPeriod() {
|
||||
return m_period;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user