Log in

View Full Version : Buttons


4085
07-02-2012, 16:41
How do you program buttons to activate an additional motor attached to your joystick? For instance, If I wanted to connect the trigger of our right joystick, where and how would we code that? We have a Logitech Attack 3 joystick and are using labview, if that helps.

WittyUsername
07-02-2012, 18:20
Use the 'unbundle' tool. Wire the Joystick's button node to unbundle's node, and you should be good to go. If no options pop up at first, try right clicking the unbundle VI and add an element.

It should work just like the axes, except the buttons only return Boolean variables. Good Luck! :D

Mark McLeod
07-02-2012, 23:47
In Teleop

position the cursor over the Buttons output node on the Joystick Get
right-click for the menu
Choose Cluster, Class and Variant
Choose Unbundle By Name (the first choice)
Place it on the Block Diagram to the right of the Joystick Get
Wire the Joystick Get Button node to the Unbundle and you should see "Button 1" appear. Expand or change the button to get the buttons you want.

Rogue Leader
08-02-2012, 00:03
Unbundle as the previous posts have mentioned, and then, to program a motor function, you can:

1.) Use a case structure to decide how the motor functions, or

2.) Use a true/false selector to pass through a number value; if all you're doing is controlling motor speed, this way is easier than a case structure.

Also, from what I hear, try not to go overboard with putting buttons on the joystick. Let the operator do most of the button pushing, and let the driver do , well, the driving! It makes the driver's job easier.

ehochstein
08-02-2012, 05:42
You can also check out this thread (http://www.chiefdelphi.com/forums/showthread.php?threadid=101711), Alan Anderson was nice enough to post a picture of what the Labview code should look like.

4085
08-02-2012, 16:58
thank you ALL but now our other issue stopping is the motor running for the shooter. We want to program the button on our joystick. We programmed it so there is 3 variable speeds and one button stopping each of these programs but also so we can re initate the program. TRUST ME we can stop the program (i.e. we have a button that stops teleop.vi completely so we need to re deploy it) thank you
-Team 4085 Technical Difficulties