Go to Post The minibot horse is dead. Stop trying to beat it. Glue is too cheap. - Taylor [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 09-12-2012, 12:38
ekapalka's Avatar
ekapalka ekapalka is offline
Registered User
FRC #3216
 
Join Date: Dec 2012
Location: Bermuda
Posts: 277
ekapalka has a spectacular aura aboutekapalka has a spectacular aura about
XBox controller

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);
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 18:20.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi