Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   2 questions regarding joysticks (http://www.chiefdelphi.com/forums/showthread.php?t=92356)

iblis432 19-02-2011 17:55

2 questions regarding joysticks
 
We have decided to not use the Attack 3 joystick and we are now going to use 1 Saitek controller. Because of this switch, I have two questions.

1. Is there a way to read POV using the Get Joystick VIs. If not, the POV also counts as buttons 12 through 20, but I would prefer not to have 8 case structures and just read the direction from the POV. I know that LabVIEW has a connectivity VI that allows the reading of POV, but it does not work with a cRIO.

2. What is the differance between a joystick 'get' vi and a joystick 'get raw' vi. Should I use the get raw if I am not using the Attack 3 controllers?

Greg McKaskle 19-02-2011 21:05

Re: 2 questions regarding joysticks
 
1. I believe the POV is returned as two of the axes. It will only return values that are multiples of 45 degrees.

2. Get returns a -1 to 1 range, raw returns integers between -128 and 127. Feel free to look at the code of both to see the differences.

Greg McKaskle

Alan Anderson 19-02-2011 21:08

Re: 2 questions regarding joysticks
 
Quote:

Originally Posted by iblis432 (Post 1026846)
...the POV also counts as buttons 12 through 20,...

The FRC Driver Station only communicates the state of joystick buttons 1-12.

MattCarey3625 19-02-2011 21:08

Re: 2 questions regarding joysticks
 
I am sorry to say that I can not answer your first question, I am unsure of what you are asking. But for the second, Get Raw gives you data such as whether a button is pressed or the axis value of the joystick. Get Joystick is rather unclear to me. For button operations use this diagram.
Use Get Raw and feed it to an 'Unbundle by Name' then you can use the boolean values that tunnel from the array to use as qualifiers for While loops or Case Structure i.e While (Button 9 == T) or If(Button 7 ==T)
Good luck!

iblis432 19-02-2011 21:49

Re: 2 questions regarding joysticks
 
1 Attachment(s)
To fix the number of buttons issue, couldn't I change the input cluster as shown in the attached picture of the joystickrawvalue.vi ?

And the Joystick we plan to use has a scale of 32470 to -32470. So wouldn't Get Raw give me those numbers and i just have to divide the output by 32470?

Greg McKaskle 19-02-2011 21:55

Re: 2 questions regarding joysticks
 
The DS protocol returns a byte per axis, so that is what raw refers to. The DS scales all HID joystick axes to the same byte range.

Greg McKaskle

iblis432 19-02-2011 22:57

Re: 2 questions regarding joysticks
 
Quote:

Originally Posted by Greg McKaskle (Post 1027072)
The DS protocol returns a byte per axis, so that is what raw refers to. The DS scales all HID joystick axes to the same byte range.

Greg McKaskle

So then no additional coding is necessary for the new joystick and it is programmed the same as an Attack 3 joystick correct?

WizenedEE 20-02-2011 01:45

Re: 2 questions regarding joysticks
 
Quote:

Originally Posted by iblis432 (Post 1027133)
So then no additional coding is necessary for the new joystick and it is programmed the same as an Attack 3 joystick correct?

Yes, any USB device that identifies itself as a "joystick" can be read by the Driver Station.

What's the verdict on the POV thing? We were just wondering about that today. I'll try probing some of the other axes tomorrow.

If that doesn't work, who wants an offseason project to figure out how to get it without using the WPI library?

iblis432 21-02-2011 10:58

Re: 2 questions regarding joysticks
 
Quote:

Originally Posted by WizenedEE (Post 1027256)
What's the verdict on the POV thing? We were just wondering about that today. I'll try probing some of the other axes tomorrow.

If that doesn't work, who wants an offseason project to figure out how to get it without using the WPI library?

For us, the POV came up as axis 5 and 6. X on the POV was axis 5 with -1 being left, 0 being center, and 1 being right. Y was axis 6 with -1 being up, 0 being center, and 1 being down.


All times are GMT -5. The time now is 09:20.

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