Log in

View Full Version : Xbox 360 controls will this work ?


gerry
05-02-2014, 16:56
ive been working on my labview xbox 360 controller just wanted to know if this will work

gerry
05-02-2014, 17:01
here the telop pics

Owen Makin
05-02-2014, 17:32
I would use a greater than or less comparison sub.vi than for your triggers. Your button code will not work because you have multiple pieces of code sending conflicting information to the robot. If you pressed a button to turn a relay on, other parts of your code will still be telling to be off. You can only have one going on at a time.

gerry
05-02-2014, 17:49
alright thanks ill make the corrections now

gerry
05-02-2014, 18:49
hows this and for the xbox control the value for the left trigger is 0 -1 and i couldn't figure how two do that one because every time i deployed it an error message came up

Mark McLeod
05-02-2014, 19:25
As Owen mentioned, you should have only one Relay Set instead of the multitude that you've got now.
It needs restructuring along the line of this example where the values you want cascade through your button choices, but the Set happens only once at the end. Each of your Relay Cases gets replaced with a Select and the values you choose in your true and false cases.
http://team358.org/files/programming/ControlSystem2009-/LabVIEW/CascadeRelay.png

gerry
05-02-2014, 19:42
how did you get the "off" constant

gerry
05-02-2014, 19:45
never mind i found it

Mark McLeod
05-02-2014, 19:46
Just Create->Constant on the input to the Relay Set, then copy and paste the constant wherever else you want to use it.

gerry
05-02-2014, 19:51
Just Create->Constant on the input to the Relay Set, then copy and paste the constant wherever else you want to use it.
yea i found it i also have a question
what i wanted to do was if button 1 and button 2 are pressed at the same time a certain action happens and if only button one is pushed a different action happens with that code that you pasted says is if button 2 and 3 are pressed then the relay will run forwards and if only button 2 is pressed then it'll run the relay reverse am i correct ? just to make sure i understand this ^.^

Mark McLeod
05-02-2014, 20:08
A little different:
No button pressed = OFF
Button 2 pressed = Reverse (unless Button 3 is pressed at the same time)
Button 3 pressed = Forward (it overrides button 2 if it is pressed at the same time)Part of what it's doing is saying which button wins if there are two commanding different actions.

gerry
05-02-2014, 20:16
A little different:
No button pressed = OFF
Button 2 pressed = Reverse (unless Button 3 is pressed at the same time)
Button 3 pressed = Forward (it overrides button 2 if it is pressed at the same time)Part of what it's doing is saying which button wins if there are two commanding different actions.
what im trying to do is make like a "condition" per say. if button 5 is pressed relay 1 will move forward however if button 2 and button 5 are pressed relay 1 will move reverse

Mark McLeod
05-02-2014, 20:41
what im trying to do is make like a "condition" per say. if button 5 is pressed relay 1 will move forward however if button 2 and button 5 are pressed relay 1 will move reverse

Just replace your button 5 with my button 2.
and your button 2 with my button 3, and you get exactly what you stated above.

if button 5 2 is pressed relay 1 will move forward however if button 2 3 and button 5 2 are pressed relay 1 will move reverse

gerry
05-02-2014, 21:19
Just replace your button 5 with my button 2.
and your button 2 with my button 3, and you get exactly what you stated above.

if button 5 2 is pressed relay 1 will move forward however if button 2 3 and button 5 2 are pressed relay 1 will move reverse
alright now if i wanted two bring in another button to that same circumstance say button 6 then i would have if button 5 is pressed relay 1 will move reverse if button 5 and 2 is pressed then relay 1 will move forward now if button 6 is pressed relay 2 will move reverse and if button 2 and button 6 is pressed the relay 2 will move forward
using the same logic for circumstance 1 how will i wire the two outcomes of both circumstances two only one wiring point would io use a (and) function ?

Mark McLeod
05-02-2014, 21:47
Just have two separate decision trees for the two different relays.
Don't try to combine them if they don't have to be. That just makes the code confusing to understand.

gerry
05-02-2014, 22:16
yes yes it does thanks for the help