02-02-2016 04:31 PM
We are a rookie team and are struggling with Labview. Our joystick 0 on our xbox controller controls the chasis motor and we want joystick one or trigger one or two to control ouro other two motors. We have watched a bunch of the videos, downloaded and watched tutorials and are still struggling. We get conflicting messages depending on what we are looking at or talking to. Some tutorials tell us to add this in teleop vi and others tell us to start with begin vi, then periodic task and then teleop vi and work your way through them. I am including a screen shot of what we created in teleop vi to run a second motor off of joystick 1. Could someone please tell me if they think this would work or at least direct us to somewhere with some up to date tutorials.
02-02-2016 11:48 PM
Can you post a picture of your begin block diagram so we can see if the motors and Joysticks are setup correctly?
02-03-2016 09:36 AM
Hi Thorbots5903,
We spoke on the phone the other day. I've posted a screenshot here that might help. In the driver station you can see the USB Gamepad has 6 axes - Left X Axis, Left Y Axis, Left Trigger, Right Trigger, Right X Axis, and Right Y Axis. Back on the block diagram, when you get the values from Joystick 0 (this gamepad) they are wired to an index array function, where you can retreive each of the axis values. By default the index array function is only expanded to show the first two elements, but you can resize it to show all 6. Once you've done that, the array elements will be in the same order as they are on the driver station (I put boxes around each to help illustrate this). You can then use the Right joystick X and Y axis to control a motor, similarly to the way arcade drive is configured.
Since both joysticks are on the same gamepad you'll reference them both as joystick 0. You shouldn't need to add joystick 1 to the block diagram.
I hope this helps, let us know if you have any other questions!
Kelly B.
National Instruments
02-03-2016 11:39 AM
I was able to expand the index array to show all six elements. Does your block diagram then show element 5 and 6 being wired to ? Having a hard time seeing what they get wired to. Thanks for the help Kelly.