![]() |
Programming Specific Button Input on Controller
Hey,
Searching didn't help much, mainly because I didn't know how to phrase the query... But what I want to know is, how could I program a specific button input on the controller? i.e., programming the trigger to activate a motor when pressed... I know I'm being a little vague but I don't really know how to phrase this question :\ Thanks, Mike |
Re: Programming Specific Button Input on Controller
In WindRiver, you can use joystickname.GetTrigger() and joystickname.GetTop() for the trigger and the top. You can then use joystickname.GetRawButton(button number).
Replace joystickname with the name of your joystick variable. Replace button number with the number of the button (each button is labelled by number on the kit joysticks). GetTrigger, GetTop, and GetRawButton return true or false. |
Re: Programming Specific Button Input on Controller
How about in LabView?
Thanks for the quick reply, btw :) |
Re: Programming Specific Button Input on Controller
Yes!
Now, you haven't mentioned if you use LabView or C, but for LabView this is what you would do: Use the "Joystick -> Get" VI. It's under WPI libraries -> RobotDrive-> Joysticks -> Get You first need to open a "channel" to that joystick. Then pass in the JoystickDevRef from the OPEN to GET There are two outputs, one for axis and one for buttons. You need a "Unbundle" vi. It's in Programming->Clusters->Unbundle (you have two choices, by name or just by blocks) Then you can select which button to read and it will give you a true or a false. keehun edit: wow you guys respond fast ;-) (while I was typing he mentioned that he used labview) |
Re: Programming Specific Button Input on Controller
Quote:
Sorry I cannot give more specific instructions than this. Perhaps someone who has worked more with LabView would be able to help. Edit: keehun just posted the appropriate instructions above. |
Re: Programming Specific Button Input on Controller
1 Attachment(s)
Also, it is possible to make a subVI that lets you select a single button output. Here's a copy of a subVI that I threw together (Sorry, haven't really tested it that much, let me know how it works!). You have to use an unsigned 16-bit int for the "index" pin, can't seem to figure out why (It says "wire enumeration conflict"). I guess speed of recursions doesn't really matter, but it's theoretically slightly faster than using the Joystick Get VI.
|
Re: Programming Specific Button Input on Controller
Keehun, I tried what you said and I've gotten this far:
![]() After this, I'm confused... how do I specify button from axis..? (btw, rookie team/freshman) EDIT: I cleaned up the wire so I'm not opening two channels for the same USB and the joystick get just comes off of the same wire now, I was just too lazy to retake the SS, so I don't need comments on how that's messed up :P |
Re: Programming Specific Button Input on Controller
Mikesername,
I think I have to solution to what you are trying to do posted in another thread. Check it out HERE. I hope it's what you're looking for. Good luck! - Austin |
Re: Programming Specific Button Input on Controller
@Austin:
Thanks! Your post with diagrams really helped! If I have any other questions about it, (which I probably will :P) I'll ask. Thanks guise. |
| All times are GMT -5. The time now is 08:47. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi