We programmed the robot for a four motor arcade drive, and the driver works fine. Though we’d like to be able to change which joystick it goes to, right now it goes to the left joystick, anybody know how to make it go to the right?
You’ll see joysticks in your driver station under the USB tab. You can use that to determine which port your joystick is plugged into or drag joysticks to the desired USB location.
In your begin VI, the joysticks are opened by USB location. The default setup has a joystick put at USB0. This is how you match the USB port for your joystick versus the USB you see in the driver station.
I saw that the right joystick is USB4-5 yet when I changed it to that in Begin.VI I lost all control of the robot in total.
It should only big a single USB. If you change to the USB number that matches, probe the wires in your code to make sure you’re reading the values from your joystick in the code. If you see the values updating going into your various motor controllers, you should see some performance. If you’re not seeing anything update here, there’s something in the code that isn’t quite right.
It’d be easier to know what you’re doing with the relevant code available. I’m mostly guessing where you might run into issues.
By right joystick, do you mean you have two joysticks or you want the right joystick from an xbox controller? If that’s the case, you’ll want to leave the USB where it was and then use the “Index Array” to pull off elements 4 and 5 instead of 0 and 1. (I believe 0 and 1 are the left joystick). This gives you the X and Y axis from the right joystick so that you’re able to use this joystick instead.
Wot?
I’ve attached some code from Teleop. This is just the basic project. But, I’ve hovered over the Index Array function to show the blue squares at the top and bottom. When you see these, you can click on them and drag to expose more elements. The top element is axis 0. The second is axis 1. Etc.
You need to use this to get the axis for the right joystick on your controller.