View Single Post
  #5   Spotlight this post!  
Unread 30-01-2010, 00:04
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,795
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: How do you get Tank Drive working?

I'll assume you know the basics of LabVIEW programming - how to wire, how to get around the palettes.
You need to do two things:
  1. Add another joystick for tank drive
  2. Switch Arcade Drive to Tank Drive
First open/close the joystick:
  • In Begin.vi copy the creation of Joystick 1 and paste it.
  • Change the new joystick open to another USB port
  • Give the new joystick a descriptive new name. e.g., "joystick 2"
  • Wire the error output to the little Build Array box. It can be expanded to expose a new node for wiring.
  • In Finish.vi copy the code for joystick 1 and paste it.
  • Change the name to "joystick 2"
Next switch to Tank Drive:
  • In Teleop.vi, in the inner case statement box select the False case.
  • Remove the axis 1 (x) wire leading to the Arcade Drive
  • Right-click on Arcade Drive, select Replace -> RobotDrive Palette -> Tank Drive
  • Copy the Joystick Get and the unbundled axis box and paste it.
  • Wire the new axis 2 (y) to the Left Axis Value node on Tank Drive
  • Now the new joystick should be added to the Joystick Read vi if you wanted to maintain the style used here, but I'm going to fall back to a simple approach and just have you add it to the left side of the block diagram.
  • Add a Joystick RefNum Registry Get.vi (the one that looks like the # Drive icon) on the far left.
  • Add a constant to the "refnum name" input node and give it the name of your second joystick
  • Wire the output JoystickDevRef through the two case statements to the Joystick Get you added.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 30-01-2010 at 20:43.
Reply With Quote