|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
How to program the Xbox 360 Wired Controller...
So, my team is trying to use the Xbox 360 controller over the provided joysticks for running our robot.
The left joystick is used for our drive motors, both x and y. We would like to use the "A" button digitally to toggle on/off another motor for collecting balls off of the ground. However, I have no clue how to do this, and really need help. Another problem is programming the right stick on the controller to control a window motor as an analog value. The only "preset" programming that works with LabVIEW is the left stick, and I would love to know how to add more variety using A, B, X, Y, and the right stick. |
|
#2
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
I'm using a logitech f510 and the button layout may be very similar (windows installed the xbox driver for it) although I can't confirm.
I suggest that to make sure you create a vi that with indicators for the joystick get axes and buttons and then map it yourself. ![]() |
|
#3
|
||||
|
||||
|
Re: How to program the Xbox 360 Wired Controller...
Once windows finishes installing drivers, plug the controller into the driver station and take a look at the joystick VI. Click on the two axis that are selected by default and change them to 1,2 for the left stick and 4,5 for the right stick (I think, I can't quite recall, but play with it a bit). Also, you might want to take a look at the "button latch" example that comes with labview to see how NI recommends you to make buttons act as latches.
|
|
#4
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
The layout CLRS97 shows is not what we got for our xBox controller. The approach of using the joystick.vi to test your actual controller is what we did. That way you know for sure what your computer and controller are registering.
|
|
#5
|
||||
|
||||
|
Re: How to program the Xbox 360 Wired Controller...
On the subject of the toggle, that is a little more complex. First, you'll need a rising edge trigger, so that the toggle doesn't get called multiple times in rapid succession. Then you'll need to send that value into the future, a shift register or something. Last, run both into an exclusive or. This is how you would do it (see attached).
|
|
#6
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
How do we find this out, what VI are you using and how can we get it to test the outputs. I assume someone can use both joysticks on the Xbox controller right? If someone could also tell us how to get this information in a vi that would be great as we also want to use both joysticks on the controller one to drive arcade style and one to control a window motor attached to a jaguar. Is that possible. Thanks a ton in advance.
TEAM 2883 |
|
#7
|
||||
|
||||
|
Re: How to program the Xbox 360 Wired Controller...
Sorry, I can't help myself: http://www.youtube.com/watch?v=bB0dI0GnOYc
I don't know if the WPILibrary has a FluxCapacitor.vi in it. A better choice of wording is that a Shift Register (or Global Variables or Local Variables) can be used to store data that can be used the next time the loop is ran. |
|
#8
|
||||
|
||||
|
Re: How to program the Xbox 360 Wired Controller...
haha, very funny.
Actually, I was referring to a feedback node. as for polling the values from the joystick, just probe the cluster coming off of the joystick get while the robot is running and move the joysticks around. It will quickly become apparent what axis is what. You should know that the POV hat is read as a joystick. You might want this to help with that (see attachment). |
|
#9
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
Quote:
|
|
#10
|
|||||
|
|||||
|
Re: How to program the Xbox 360 Wired Controller...
Run the Robot Main vi. Open Teleop and probe the Axes and Buttons outputs from the Joystick Get while the robot is enabled. You will see the results in the probe window.
|
|
#11
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
A way you could tell what buttons are which in LabVIEW is to open the joystick and get button and axis information using the "Open" and "Get" VI's in the WPI robotics library. You can connect an "unbundle by name" block from the cluster palette to get the button/axis info after you get the info from "Get" VI. Then you can hook up some booleans to the info to see button info. And as for joystick info, you can create a boolean light, then on the block diagram, right click, "create", "property node", "position", then "left", and "top". Right click those nodes, and click "change to write" so the joysticks can control their position on the front panel (you might need a scalar to make the joysticks less sensitive). Although, your right joystick should be able to get the motor to work... (Hope this helped).
|
|
#12
|
|||
|
|||
|
Re: How to program the Xbox 360 Wired Controller...
this is my first time programming a xbox 360 controller can any one help me on figuring out what to put in the begin vi and the telop vi so i can use the controllers left joystick as the front and back and the right joystick as the left and right motion
|
|
#13
|
|||||
|
|||||
|
Re: How to program the Xbox 360 Wired Controller...
Quote:
Look back a couple of posts (and a couple of years) for a suggestion on how to determine which controls appear on which axes of the Joystick Get function. |
|
#14
|
|||||
|
|||||
|
Re: How to program the Xbox 360 Wired Controller...
Here you are, from another recent thread
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|