Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Programming a Victor motor (Logitech Joysticks) (http://www.chiefdelphi.com/forums/showthread.php?t=110857)

Ganondalf 09-01-2013 19:26

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!

Mark McLeod 09-01-2013 19:37

Re: Programming a Victor motor (Logitech Joysticks)
 
1 Attachment(s)
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.

Ganondalf 09-01-2013 19:38

Re: Programming a Victor motor (Logitech Joysticks)
 
That'll do it! Thanks!

Greg McKaskle 09-01-2013 19:42

Re: Programming a Victor motor (Logitech Joysticks)
 
1 Attachment(s)
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

Ganondalf 09-01-2013 19:47

Re: Programming a Victor motor (Logitech Joysticks)
 
Thank you so much!


All times are GMT -5. The time now is 10:52.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi