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

Joystick j = new Joystick(final int usbPort);

usbPort is the USB slot the joystick is plugged into on the laptop you’re using.

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.

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?

From my experience the Joysticks will stay the same, so I don’t believe it will restore.

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.