|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to use a Joystick
Correct me if I am mistaken, but we no longer use the blue driver station. Nowadays everything goes through the classmate. If I understood that correctly I need help creating a Joystick object. On the blue box you would say that the joystick on the 1st usb port will be the left one and 2nd will be the right. How do you tell it where to look for the joystick now?
Joystick stickLeft = new Joystick(????????); |
|
#2
|
||||
|
||||
|
Re: How to use a Joystick
Joystick j = new Joystick(final int usbPort);
usbPort is the USB slot the joystick is plugged into on the laptop you're using. |
|
#3
|
|||
|
|||
|
Re: How to use a Joystick
You are correct, now we use the classmate as the driver station however not much has changed. To create a joystick object you still would write;
Joystick driveStick = new Joystick(x); //where x is where the joystick is plugged in And to check which is which, there is a tab (which I'm blanking on the name) on the driver station that allows to you see the currently plugged in joysticks and re-arrange the order of the joysticks. |
|
#4
|
|||
|
|||
|
Re: How to use a Joystick
Thanks. That's what I needed. just so that I know: which is port 1 and which is port 2 by default, and do these defaults get restored upon every boot or will it remember my settings when I tell it which port is which?
|
|
#5
|
|||
|
|||
|
Re: How to use a Joystick
From my experience the Joysticks will stay the same, so I don't believe it will restore.
|
|
#6
|
||||
|
||||
|
Re: How to use a Joystick
no matter which usb ports you plug the joysticks into (or even though a hub) they will show up as usb 1, 2, 3, ect depending on the number of joysticks. You do not need to worry about have joysticks on ports 1 and 3 by default.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|