View Single Post
  #2   Spotlight this post!  
Unread 14-04-2011, 16:16
vhcook's Avatar
vhcook vhcook is offline
Reader of Things
AKA: Victoria
FRC #1939 (Kuh-nig-its)
Team Role: Mentor
 
Join Date: Feb 2007
Rookie Year: 2006
Location: Kansas City, MO
Posts: 546
vhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond reputevhcook has a reputation beyond repute
Re: How do you set up a controller code

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.
__________________


Reply With Quote