|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hello,
I'm curious as to how i would program the button labeled 2 on the logitech joystick connected to USB port 1 on the ds. like for example.... When button 2 on joystick 1 is pushed, set relay 8 to fwd on the NI9472 module or something like that. Any help would be greatly appreciated. |
|
#2
|
||||
|
||||
|
Re: Programming a joystick button...
In your code you should have something like
Joystick *leftstick; then further down you should have leftstick = new Joystick(1); make sure leftstick matches the name of your joystick object. var = leftstick->GetRawButton(button number); Thats it |
|
#3
|
|||
|
|||
|
Re: Programming a joystick button...
By going to WPI Robotics Library -> RobotDrive -> Joystick -> Get and placing it down in your main loop, there is an output called "buttons". This output is a bundle, which can be unbundled with Cluster, Class, ... -> Unbundle. Connect the wires and you should see a rectangle with 12 slots, representing the 12 buttons on the default controller. Then, you would link each of the slots with a case structure (Structures -> Case Structure) and add your drive code in it.
Here's a picture of what it should look like (sorry if its not the convention for posting LabVIEW code on the site. I'm not sure what it is) ![]() This topic might also be helpful: http://www.chiefdelphi.com/forums/sh...ad.php?t=70564 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| button programming | joesmomh00haha | Programming | 12 | 10-02-2007 10:36 |
| Using a button on a joystick to track? | DemonYawgmoth | Programming | 5 | 12-02-2006 11:17 |
| Joystick Hat button | ten3brousone | Programming | 8 | 20-02-2005 13:31 |
| Joystick Button programming | Bharat Nain | Programming | 5 | 18-02-2005 11:48 |
| Joystick Button Deference | cibressus53 | Electrical | 3 | 01-11-2004 09:38 |