2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00

Added DentRobot.h

This commit is contained in:
Austen Adler 2015-01-16 19:49:16 -05:00
parent 180884bfe7
commit 0036f2dd7a
2 changed files with 47 additions and 37 deletions

View File

@ -1,38 +1,25 @@
#include "WPILib.h" #include "DentRobot.h"
#include "Commands/Drive.h" DentRobot::DentRobot():
#include "Commands/Collect.h" driveCommand(new Drive()){
#include "Commands/Eject.h" printf("Initialized");
#include "Commands/Raise.h" }
#include "Commands/Lower.h" void DentRobot::RobotInit(){
class DentRobot: public IterativeRobot { printf("Initializing");
private:
Command *autonomousCommand = NULL;
LiveWindow *lw;
void RobotInit() {
CommandBase::init(); CommandBase::init();
lw = LiveWindow::GetInstance();
} }
void DisabledPeriodic() { void DentRobot::DisabledPeriodic(){
Scheduler::GetInstance()->Run(); Scheduler::GetInstance()->Run();
} }
void AutonomousInit() { void DentRobot::AutonomousInit(){
if(autonomousCommand != NULL) {
autonomousCommand->Start();
} }
} void DentRobot::AutonomousPeriodic(){
void AutonomousPeriodic() {
Scheduler::GetInstance()->Run(); Scheduler::GetInstance()->Run();
} }
void TeleopInit() { void DentRobot::TeleopInit(){
if(autonomousCommand != NULL) {
autonomousCommand->Cancel();
} }
} void DentRobot::TeleopPeriodic(){
void TeleopPeriodic() {
Scheduler::GetInstance()->Run(); Scheduler::GetInstance()->Run();
} }
void TestPeriodic() { void DentRobot::TestPeriodic(){
lw->Run();
} }
};
START_ROBOT_CLASS(DentRobot); START_ROBOT_CLASS(DentRobot);

23
src/DentRobot.h Normal file
View File

@ -0,0 +1,23 @@
#ifndef DENTROBOT_H
#define DENTROBOT_H
#include "WPILib.h"
#include "Commands/Drive.h"
#include "Commands/Collect.h"
#include "Commands/Eject.h"
#include "Commands/Raise.h"
#include "Commands/Lower.h"
class DentRobot: public IterativeRobot {
private:
Command *driveCommand = NULL;
public:
DentRobot();
void RobotInit();
void DisabledPeriodic();
void AutonomousInit();
void AutonomousPeriodic();
void TeleopInit();
void TeleopPeriodic();
void TestPeriodic();
};
#endif
// vim: ts=2:sw=2:et