Programming a Victor motor (Logitech Joysticks)

Hello, I have a victor motor and what I want to do is have the trigger on my right joystick spin the motor one direction and the trigger on my left the other. I’m using two joysticks (tank drive). How would I do this using LabVIEW. Thanks in advance!

Allons-y!

This doesn’t have everything wired, but it might give you the idea.
You have to open the motor in Begin.vi, name it, and use both the motor and joystick names in Teleop.vi.

buttonDrive.png


buttonDrive.png

That’ll do it! Thanks!

Make sure that in Begin.vi, you open a reference to both joysticks and store them by name. By default there is only one being opened. Also make sure to open the motor controller and store it with a name.

In TeleOp, retrieve the refnums using the names and run code similar to below.

The code uses the select node to choose a value depending on the state of the button, and when it is time to combine the button values, I simply added them, deciding that if both are pressed, don’t spin the motor at all. I decided to spin the motors at half speed, so I use 0.5 and -0.5.

Greg McKaskle





Thank you so much!