![]() |
Xbox 360 controllers
I am relatively new to java and i was wondering if anyone has gotten a xbox360 controller was using one. If so how do you hook it up? Can you just use the Joystick class in java? and How do you distinguish between axises in java? any answers would be greatly appreciated and I do have a wireless and a wired controller if that makes it easier.
|
Re: Xbox 360 controllers
We are using a wired Xbox 360 controller in Java with no problems. Just install the drivers on the Classmate, plug it in, and access it using the Joystick class.
For more information, and a mapping of controller axes to Joystick class axes, see: http://www.chiefdelphi.com/forums/sh...threadid=82825 |
Re: Xbox 360 controllers
I can get the Xbox360 controller hooked up but actually using it to drive in java with multiple joysticks on the controller and if someone could tell me what buttons are what in java?
But the thing I really don't understand is how you get multiple joysticks on the controller working and pick one to use? |
Re: Xbox 360 controllers
Read the link in my reply.
Quote:
Code:
Joystick mXboxController = new Joystick(1); // Where "1" is the index of the joystick (you can set this in the Driver Station software).Code:
double axisValue = mXboxController.getRawAxis(2); // Where "2" is the index of the Y axis on the left stick (see above)Code:
boolean buttonPressed = mXboxController.getRawButton(1); // Where "1" is the index of the button reported by the Windows Control Panel "Game Controllers" display |
Re: Xbox 360 controllers
Thank you so much this has been a huge help the only thing i need now is the button layout and i can get that
|
Re: Xbox 360 controllers
just remember to set a buffer b/c the sticks are waay too sensitive
|
Re: Xbox 360 controllers
Quote:
|
Re: Xbox 360 controllers
and how exactly do you set that in the code
|
Re: Xbox 360 controllers
I'm not sure on the FRC specifics, but assuming a range of 0-255 with 127 being the middle (I dunno if that's how Xbox joysticks are defined so adjust accordingly)... just if (xBox < 140 || xBox > 110) { return 127;} or something like that.
|
Re: Xbox 360 controllers
How can you use the left stick on the xbox controller to program an arcade drive on Java? Furthermore, how can you take input from the bumpers and the X,Y,B, and A buttons? Any sample code would be appreciated.
|
Re: Xbox 360 controllers
Quote:
|
Re: Xbox 360 controllers
Quote:
|
Re: Xbox 360 controllers
Quote:
|
Re: Xbox 360 controllers
Quote:
|
Re: Xbox 360 controllers
Quote:
Code:
if(Math.abs(xboxControler.getRawAxis(2)) > .1) |
| All times are GMT -5. The time now is 12:08. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi