Change loop time in C++

Anyone have sample code on how to change the default loop time in C++?

I’m a newer programming mentor and I am not strong on C++ syntax. I found the following on the FIRST resources site, but I’m not sure if this goes in the Robot.h header file under public: or elsewhere.

Robot(): frc::TimedRobot(30_ms){};

I get build errors when I try to do
class Robot : public frc::TimedRobot(30_ms) {

For more info, our code can be found under

That snippet is the constructor.

class Robot : public frc::TimedRobot {
  Robot() : frc::TimedRobot(30_ms) {}

Thank you! I didn’t get a build error. I’ll try this on the robot tomorrow.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.