Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   How to use a Joystick (http://www.chiefdelphi.com/forums/showthread.php?t=99852)

sebflippers 11-01-2012 17:33

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(????????);

Djur 11-01-2012 18:07

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.

pudgeball 11-01-2012 18:11

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.

sebflippers 11-01-2012 18:23

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?

pudgeball 11-01-2012 18:31

Re: How to use a Joystick
 
From my experience the Joysticks will stay the same, so I don't believe it will restore.

gixxy 13-01-2012 13:08

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.


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

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