Thread: Xbox Controller
View Single Post
  #11   Spotlight this post!  
Unread 23-06-2014, 14:49
notmattlythgoe's Avatar
notmattlythgoe notmattlythgoe is offline
Flywheel Police
AKA: Matthew Lythgoe
FRC #2363 (Triple Helix)
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2009
Location: Newport News, VA
Posts: 1,722
notmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond reputenotmattlythgoe has a reputation beyond repute
Re: Xbox Controller

Quote:
Originally Posted by LFRobotics View Post
Okay I get it - but why cant I just continue to use

Code:
Joystick joystick = new Joystick(1);
private Button button = new JoystickButton(joystick, 0);
to assign my buttons or even

Code:
private Button button = new JoystickButton(joystick, joystick.getRawButton(0));
instead of having to create a whole new class.

And if it is completely necessary to do so I would need some help - I have an idea of what to do but I would still need some guidance.

THANKS!
You don't need a whole new class. Writing the new class will just make it easier in the future to write code using the xbox controller, but they literally do the exact same thing.

Just using the JoystickButton along with the Joystick class is a perfectly fine way to do it. So for you I'd suggest you stick with the below for now.
Code:
Joystick joystick = new Joystick(1);
private Button button = new JoystickButton(joystick, 0);
Reply With Quote