ShotgunNinja
18-01-2009, 20:18
Hey all,
I was messing with LabVIEW and found that there was a Joystick Get and a Joystick Get Axis subVI, but no Joystick Get Button. So I made one. Please let me know if there are any errors, I can't test it right away. This is based off of the Joystick's Get.vi that is included with LabVIEW, and it basically serves to eliminate the hassle of using a cluster element selector block. Enjoy, and give feedback please!
P.S. - The "Index" pin is where you'd wire up an enumerated button selector. It's an unsigned byte value, with enumerated items "Button 1" ... "Button 11" and "Invalid". You could also just put in any unsigned integral, though; it should cast down properly. The output is a single boolean, indicating whether the button is pressed or not. Also, keep in mind that Button 1 (the trigger) is enumerated to 0, not 1.
I was messing with LabVIEW and found that there was a Joystick Get and a Joystick Get Axis subVI, but no Joystick Get Button. So I made one. Please let me know if there are any errors, I can't test it right away. This is based off of the Joystick's Get.vi that is included with LabVIEW, and it basically serves to eliminate the hassle of using a cluster element selector block. Enjoy, and give feedback please!
P.S. - The "Index" pin is where you'd wire up an enumerated button selector. It's an unsigned byte value, with enumerated items "Button 1" ... "Button 11" and "Invalid". You could also just put in any unsigned integral, though; it should cast down properly. The output is a single boolean, indicating whether the button is pressed or not. Also, keep in mind that Button 1 (the trigger) is enumerated to 0, not 1.