I am currently learning C and am programming are robot to use the 360 controller, and I want to use the Xbox button as a “turbo” button to speed up the robot a little. Can anyone please give me a code I can try, or at least a tip? You can email it to me at [email protected]. Thanks.
I assume you are using a Chicklet to interface with the XBox 360 controller.
The XBox button is not mapped to an output on the chicklet. That button is not even available on a computer, so I’m guessing you would need special, non-HID, drivers to get the buttons’s state.
The port mappings for the Chicklet are available in this manual.
EDIT: If you are looking for code not specific to the 360 controller PM or e-mail me.
Speaking of the chicklets, from what I’ve read, I need to do some process to edit the buttons on the xbox and convert them to analog outputs(p1_x, p1_y, p1_trig etc.).
If so, can anyone explain a bit? I didn’t quite understand from the manual, it looks complicated. : \
Yes We are using the chicklet. But on the chart that says buttons for 360 controller it says “center X button.” So it is supported but i can’t find out how to actually use it.
I should have read the entire manual.:rolleyes:
You will need to go through the calibration routine. During step 5 you can select which buttons will be used. Instructions can be found on page 4 of the manual I linked to above.
If you need more help I’m on MSN/Live Messenger(my handle is in my profile) almost all day.
usb controllers that the chicklet supports have more buttons than the analog OI port can handle. we used the 360 controller this year. i’m pretty sure you can use the giant X button, but i’m not 100% sure cez we didnt. in the chicklet manual it shows the different “modes” some modes allow more buttons than axes. if you intend on using both joysticks, then you’ll only be able to use 4 digital buttons. but, if you only choose to use certain axes, you can use more buttons. what the chicklet does is takes unuses analog channels and assigns each bit a digital value.
0000 0000 - this is a BYTE, or 8 BITS
when you use the extra buttons feature, the last 4 bits of an analog byte get assigned values
0000 0001 - this is what happens when a button assigned (when you onfigure the chicklet…instructions are in the manual posted above).
in binary, this is a value of 1
0000 0010 - this is a value of 2
0000 0100 -this is a value of 4
0000 1000 - this is a value of 8
0001 0000- 16
0010 0000- 32
0100 0000- 64
1000 0000- 128
this is all you need to know. so when you configure the chicklet and press the buttons you configures to it, the actual analog output going to the OI equals one of the above.
so lets say the A button is 8…to make the robot way that the A button has been pressed would look like this:
if(p1_aux==8){ //p1_aux is the auxilary analog channel on port 1
Do_something(); //when the button is pressed, insert what you need
}
this is just an example, but this is basically how the chicklet works. read through the manual for more. if you need and more help, feel free to PM me.
good luck and have fun
~tseres
Read through the manual for the correct information. It’s the top four bits (128, 64, 32, 16) which represent digital switch values. You should test the individual bits rather than the analog value as a whole, as the lower few bits cannot be guaranteed to be consistent.
There are 17 supported buttons on an Xbox 360 controller. The Chicklet can assign any 12 of them to be sent to the joystick port, four as “real” switch inputs and eight encoded in the Wheel and Aux analog values. Using it this way means you can only get “real” joystick values from two of the possible four axes on the controller. You can choose to get x and y inputs from both the left and right joysticks, but that restricts you to a total of four switch inputs. This is all in the Chicklet manual.
Ok, that should be more easier to understand. Thanks.
my mistake. but the concept is still the same. i have some code we used this year. i’ll post it later when i can find it.