Created
December 16, 2013 21:24
-
-
Save Michael0x2a/7994689 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "WPILib.h" | |
class RobotDemo : public SimpleRobot | |
{ | |
private: | |
RobotDrive myRobot; | |
Joystick stick; | |
public: | |
RobotDemo(void): | |
myRobot(1, 2), | |
stick(1) | |
{ | |
myRobot.SetExpiration(0.1); | |
} | |
void Autonomous(void) | |
{ | |
myRobot.SetSafetyEnabled(false); | |
myRobot.Drive(-0.5, 0.0); // drive forwards half speed | |
Wait(2.0); | |
myRobot.Drive(0.0, 0.0); | |
} | |
void OperatorControl(void) | |
{ | |
myRobot.SetSafetyEnabled(true); | |
while (IsOperatorControl()) | |
{ | |
myRobot.ArcadeDrive(stick); | |
Wait(0.005); | |
} | |
} | |
void Test(void) | |
{ | |
} | |
}; | |
START_ROBOT_CLASS(RobotDemo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment