Log in

View Full Version : Buttons on a Attack 3 Joystick useing LABView


morg102
14-01-2009, 20:06
I have found many post's but no answers on this subject.
Please dont give me outside links or links to other topics here
I would just like to know how to spesifiy witch button on the joystick i am useing.

Thanks,
1141

DRH2o
14-01-2009, 20:27
Right click on the "Buttons" cluster -- Go to the "Cluster Pallette -- Click unbundle -- wire that to the Button out -- wire to the button you want.

Hope that helps.

TotalChaos
14-01-2009, 20:41
Here's a bit more of a visual in case you're using the basic framework (Pretty much what DHR2o said):

Go to your palette and go to "WPI Robotics Library" > "DriverStation" > "Joystick" and add a "Get.vi" .. hook it up to the connector shown below:
http://img67.imageshack.us/img67/8347/14362791jd3.jpg

Go to your palette and go to "Programming" > "Cluster, Class & Variant" and add an "Unbundle by name". Hook it up to the pink output of the get VI as shown below:
http://img103.imageshack.us/img103/8862/22256183hc3.jpg
http://img210.imageshack.us/img210/6330/66729433lu4.jpg

Now from the cluster outputs you have access to all of the buttons.
http://img210.imageshack.us/img210/8317/66086042tt4.jpg

Good luck!

- Austin

morg102
15-01-2009, 00:08
Thanks, me and the other programer found a salution but this is alot better.

CPUGenuis
19-01-2009, 15:55
wait, what's the difference between using get and get raw for the buttons?

TotalChaos
19-01-2009, 16:14
As far as the buttons go, nothing. The only difference I know of is the joystick axis output ranges from like -30000 something to +30000 something in increments of 256 or 512 or something around there...

- Austin

CPUGenuis
19-01-2009, 16:29
lol, k. thanks.

GunfighterJ
30-01-2009, 17:16
As far as the buttons go, nothing. The only difference I know of is the joystick axis output ranges from like -30000 something to +30000 something in increments of 256 or 512 or something around there...

- Austin

The joystick ranges from -1 to 0 to 1. If it is scaled to 127 (which it is set to by default) then the joystick ranges from -127 to 0 to 127. Which gives you a more finer control over a motor.

TotalChaos
30-01-2009, 17:19
The joystick ranges from -1 to 0 to 1. If it is scaled to 127 (which it is set to by default) then the joystick ranges from -127 to 0 to 127. Which gives you a more finer control over a motor.

Ah, that's right... When I wrote that I was thinking about the preseason when we had a joystick hooked up to the computer directly and got input through the computer... My bad.

- Austin

mcristina444
08-02-2009, 12:53
what is the joystick axis output?? it is really -1 to 1??? or is it 0 to 256 or -158 to 158

Greg McKaskle
08-02-2009, 13:04
-1 to 1. If you have a running system, don't forget that in LV you can open the panel and watch the values as they flow through. Many times that is a good way to understand the values being sent.

Greg McKaskle

Mohit
02-02-2010, 15:35
I want to program in a way that when i press the trigger the motor works at half speed...
I don't know how to do it.. I did a little bit of the steps that were mentioned above and it really didn't help. So can you tell me how to do it??
If you can provide pictures with that I would really appreciate..
Thank you..
Mohit

Pausert
02-02-2010, 16:02
Create a case structure. Wire the button input to the case structure's "?" node. Then make the "True" case have a 0.5 constant in it. Make the "False" case have a 0 constant in it. Wire both the constants out of the case structure to the Set Motor VI. Voila!

Mohit
02-02-2010, 21:42
Thank you for the help..
I'll let you know if it works once I get to school tommorow and start working on it..

Ziaholic
02-02-2010, 23:28
Here's a shot of something that doesn't do exactly what you want, but it's close and easily modifyable ... our trigger overrides the throttle and sets it to full speed.

In the pic, the case structure shows the FALSE case, where the throttle goes straight thru, but when button 1 is pressed, the TRUE case has a hard constant 1.0 wired up into the throttle output of that case structure, ignoring the actual joystick throttle until the button is released.

In your case, you'd wanna' wire up a 0.5 constant to it, if you want half-speed.