Log in

View Full Version : How do you set up a controller code


Joel Johnson
14-04-2011, 16:08
I was wondering how to set up a code that allows another controller to control a certain function. Like moving an arm up or down. The driver has control of every thing right now, and we would like to get some of it off his shoulder thanks.

vhcook
14-04-2011, 16:16
If you're trying to add a new joystick, then in Begin.VI, you'll need to add a joystick open function indicating which USB port to expect it on, then wire it over to a Joystick SetReference VI and give it a name. Make it look like the one that's already there, just name it something else.

In Teleop, you would do a Joystick GetReference using the name you set in Begin.vi (spelling counts), and wire it to a Joystick GetValue (or whatever that's called - not in front of my programming PC just now). Unbundle the Axes or Buttons outputs by name as needed. Wire the output of that into your control code where the driver joystick is currently wired in, and remove the connections from the driver joystick, and you should be good to go.

Joel Johnson
14-04-2011, 16:26
Thank you very much.:)

j.cole
17-04-2011, 10:39
You must have a really good driver that he has been able to drive and control the arm this whole time. I know I couldn't do it myself.