|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Joystick Buttons?
I need help programming the KOP joystick buttons in LabView using the Basic Framework. We are trying to turn a motor clockwise when Joystick button 4 is pressed then invert the motor when Joystick button 5 is pressed. With our current code we can get button 5 to spin a motor, BUT nothing happens when button 4 is pressed.
We have tried a number of different fixes. It seem that this multiple button issue always occurs when we try to program more than one button to activate the same motor. I've attached a picture of our recent failure. Can anyone help! Last edited by grosh : 13-03-2009 at 22:57. |
|
#2
|
||||
|
||||
|
Re: Joystick Buttons?
You've opened a motor twice. Try sending a wire branch to the second case stament instead of opening PWM 5 twice.
Also nestle the case statements - so put the button 5 case statment within the false of the button 4 statement or vise versa. Make sense? Last edited by rhoads2234 : 16-02-2009 at 14:29. Reason: clarification |
|
#3
|
|||
|
|||
|
Re: Joystick Buttons?
Would nesting make the motor spin when NO buttons are pressed? We don't want the motors to spin unless a button is pressed.
Opening the motors twice was a failed fix. We have changed that back. |
|
#4
|
||||
|
||||
|
Re: Joystick Buttons?
you can't open a motor twice. It will have a race condition and they will fight each other. We had that with tank drive, so if that isn't your problem, then look else where.
Also, try making a sub vi for the opening of motors, then a sub vi for logic depending on the values, then make a close sub vi. |
|
#5
|
|||
|
|||
|
Re: Joystick Buttons?
If we take the SetSpeed=0 out of the false conditions we can get both buttons to work. HOWEVER, now it doesn't stop.....!
Does that help anyone? |
|
#6
|
||||
|
||||
|
Re: Joystick Buttons?
make both of the joysticks come in on a Or statement. (the image is my code)
|
|
#7
|
||||
|
||||
|
Re: Joystick Buttons?
your set speed to 0 would be in the false statement of the interior case statement.
This would make the motor stop when no buttons are pressed but if one or the other is, it will send that value. -so I will walk you through it (I don't have Labview on this computer) Open Motor get button 5 ___Case statement _____true ________set speed to Right Crab speed inverse _____false ________get button 4 ________Case Statement __________true _____________set speed to Right Crab speed __________false _____________set speed to 0 Last edited by rhoads2234 : 16-02-2009 at 16:27. Reason: make the code clearer |
|
#8
|
|||
|
|||
|
Re: Joystick Buttons?
I think we got it!!!!!!!!!!!!!!!!!!! Wow, thanks everyone. I think we might be ready to ship.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Labview Joystick Buttons... | team877 | NI LabVIEW | 36 | 17-02-2009 19:23 |
| Joystick buttons | Team_2547 | NI LabVIEW | 1 | 24-01-2009 19:42 |
| Joystick Buttons | KRibordy | C/C++ | 6 | 24-01-2009 10:06 |
| Buttons to Pins on Joystick | yarb65 | Electrical | 1 | 24-08-2007 20:39 |
| Assigning Joystick buttons.... | archiver | 2001 | 5 | 24-06-2002 00:59 |