01-14-2015 01:55 PM
Hey macro,
Yes, the outputs from the WPI_Joystick_GetValues.vi (in this year, FRC 2015) are a different format from the outputs of the WPI_Joystick_Get.vi (from last year, FRC 2014.
Now it just outputs an array of doubles for all the Axes, and an array of booleans for all the Buttons.
Use Index Array to extract the Axes you need (in the example below, Axis 0 and Axis 2) and the Buttons you need (below, Buttons 0, 2, 5, and 6).
Sounds like you are on the right track!
-Ryan
01-14-2015 03:04 PM
Ryan,
Thanks for your freply,
It's now clear for me what the index array for, but is there any specific name to call the Axis (Axis 0 or axis0...) and if I need to use more then two Axis, Throttle, how the configuration should be on the input and output for the index array?
Same for the buttons
I don't see any link for the example you just mention.
Thanks for your help
macro
01-14-2015 03:22 PM
I've included a VI snippet that you can drag into your teleop code that shows how this works.
You may want to save off the index of each axis once you find them to avoid searching for them each time your code runs.
01-14-2015 04:18 PM
Dear DAQjr,
I don't have the vi file that I can drag to the teleop can ypu please resend it for me.
Thanks
01-14-2015 04:21 PM
Just drag the image... it will turn into code.
01-14-2015 04:21 PM
Hi macro009,
The image in DAQjr's post can be dragged and dropped into a LabVIEW VI. Its called a VI Snippet, and you can find more information on it here: http://www.ni.com/white-paper/9330/en/
01-14-2015 04:32 PM
Thanks because I tried to dragg it before didn't work now it's working fine.
thanks again
01-14-2015 04:55 PM
I still don't know how to set the buttons based on what Ryan says, I didnt see it in the example that was displayed (Button 1, 2,..6)
Please can you help?
Thanks
macro
01-14-2015 05:40 PM
Unfortunately the joystick API for HID and XBox does not have a way to describe the buttons on a joystick, and as such we can't pass that on to you.
If your joystick has numbered buttons, then you basically just index the array with that number (make sure you subtract one if the joystick buttons start at "1"). You can also simply experiment to find the indices of the buttons you care about. The buttons will always have the same order in the array.
01-15-2015 08:51 AM
Hello,
Another question concerning WPI_JoystickGet.vi.
Is it possible to use the WPI_Joystickget.vi (used in the FRC 2014) instead of the WPI_JoystickGetValue.vi (used this season FRC2015).
Or in other word replace the FRC2014 teleop.vi instead of the FRC2015 teleop.vi.
If yes How can we add the WPI_JoystickGet.vi to the WPI Robotic Library function under the Joystick palettes, since the WPI_JoystickGet.vi still located under C: >program files (x86)>...>Rock Robotics>WPI>Joystick>.
Regards,
macro