Go to Post I don't actually have any hex shaft stock in my house (I live in an unusual household). - ollien [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
  #4   Spotlight this post!  
Unread 09-12-2012, 17:51
Toa Circuit's Avatar
Toa Circuit Toa Circuit is offline
Thaddeus Maximus
AKA: Thad Hughes
FRC #4213 (MetalCow Robotics)
Team Role: Leadership
 
Join Date: Nov 2012
Rookie Year: 2012
Location: Shirley, IL
Posts: 131
Toa Circuit is an unknown quantity at this point
Re: XBox controller

I had tried an xBox controller once, and had poor experiences with it.
I could not:
1. Get the left joystick Y axis value
2. Independently access the analog triggers

I had subclassed it and used the Joystick.GetRawAxis() functions. Everything else worked, but I couldn't get those things out of it.

Then again, that was my experience. If you wanted it to work, you should use the GetRawAxis(x) functions as said before.

Lets say you setup everything like you had before and plugged the xBox controller in as the first controller. Here is what you would write:
Code:
	void Autonomous(void)
	{
		myRobot->SetSafetyEnabled(true);
				
			while(IsAutonomous())
			{
			myRobot->Drive(leftStick->GetRawAxis(1), leftStick->GetRawAxis(2));
			}
	}
By doing this, we are doing what Zuelu562 had done somewhat, just minus creating extra variables that make code messier and use up more memory. You just pass the value you want the robot to move rather than passing a joystick to it. Zuelu562 also gave a spreadsheet that listed out all the values of buttons and axes, so you can replace the 1 and 2 with whichever values you like. This seemed to match up with what I had.
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 03:31.

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