Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   NI LabVIEW (http://www.chiefdelphi.com/forums/forumdisplay.php?f=182)
-   -   Xbox 360 controls will this work ? (http://www.chiefdelphi.com/forums/showthread.php?t=125873)

gerry 05-02-2014 16:56

Xbox 360 controls will this work ?
 
ive been working on my labview xbox 360 controller just wanted to know if this will work

gerry 05-02-2014 17:01

Re: Xbox 360 controls will this work ?
 
2 Attachment(s)
here the telop pics

Owen Makin 05-02-2014 17:32

Re: Xbox 360 controls will this work ?
 
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

Re: Xbox 360 controls will this work ?
 
alright thanks ill make the corrections now

gerry 05-02-2014 18:49

Re: Xbox 360 controls will this work ?
 
1 Attachment(s)
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

Re: Xbox 360 controls will this work ?
 
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.

gerry 05-02-2014 19:42

Re: Xbox 360 controls will this work ?
 
how did you get the "off" constant

gerry 05-02-2014 19:45

Re: Xbox 360 controls will this work ?
 
never mind i found it

Mark McLeod 05-02-2014 19:46

Re: Xbox 360 controls will this work ?
 
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

Re: Xbox 360 controls will this work ?
 
Quote:

Originally Posted by Mark McLeod (Post 1338203)
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

Re: Xbox 360 controls will this work ?
 
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

Re: Xbox 360 controls will this work ?
 
Quote:

Originally Posted by Mark McLeod (Post 1338220)
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

Re: Xbox 360 controls will this work ?
 
Quote:

Originally Posted by gerry (Post 1338225)
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

Re: Xbox 360 controls will this work ?
 
Quote:

Originally Posted by Mark McLeod (Post 1338236)
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

Re: Xbox 360 controls will this work ?
 
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

Re: Xbox 360 controls will this work ?
 
yes yes it does thanks for the help


All times are GMT -5. The time now is 20:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi