Files
allwpilib/eclipse-plugins/edu.wpi.first.wpilib.plugins.cpp/resources/templates/command-based/Robot.cpp
Kevin O'Connor f99b57b1fe Run the scheduler in disabled (fixes artf3631)
Change-Id: Ib1614e2c96b4cda580110ea427398bcfe2ff6fbe
2014-10-15 15:32:38 -04:00

56 lines
934 B
C++

#include "WPILib.h"
#include "Commands/Command.h"
#include "Commands/ExampleCommand.h"
#include "CommandBase.h"
class Robot: public IterativeRobot
{
private:
Command *autonomousCommand;
LiveWindow *lw;
void RobotInit()
{
CommandBase::init();
autonomousCommand = new ExampleCommand();
lw = LiveWindow::GetInstance();
}
void DisabledPeriodic()
{
Scheduler::GetInstance()->Run();
}
void AutonomousInit()
{
autonomousCommand->Start();
}
void AutonomousPeriodic()
{
Scheduler::GetInstance()->Run();
}
void TeleopInit()
{
// This makes sure that the autonomous stops running when
// teleop starts running. If you want the autonomous to
// continue until interrupted by another command, remove
// this line or comment it out.
autonomousCommand->Cancel();
}
void TeleopPeriodic()
{
Scheduler::GetInstance()->Run();
}
void TestPeriodic()
{
lw->Run();
}
};
START_ROBOT_CLASS(Robot);