Hello!
First of all, let it be said that I am new to robot programming. What I have been trying to do is modify the code below to utilize an xBox 360 controller. I have literally gone through every forum entry with the keyword "xBox" which resulted in nothing more than being lead to other entries and dead links to websites. I have already installed the drivers and tried treating the controller as a typical joystick. If anyone could Help, I would greatly appreciate it! Thanks!
Code:
#include <WPILib.h>
class DefaultRobot : public SimpleRobot
{
Joystick *leftStick;
Joystick *rightStick;
RobotDrive *myRobot;
public:
DefaultRobot(void)
{
leftStick = new Joystick(1);
rightStick = new Joystick(2);
myRobot = new RobotDrive(1, 3, 2, 4);
myRobot->SetExpiration(0.005);
}
void Autonomous(void)
{
myRobot->SetSafetyEnabled(true);
while(IsAutonomous())
{
}
}
void OperatorControl(void)
{
myRobot->SetSafetyEnabled(true);
while (IsOperatorControl())
{
myRobot->ArcadeDrive(leftStick);
Wait(0.001);
}
}
};
START_ROBOT_CLASS(DefaultRobot);