Thread: XBOX button
View Single Post
  #1   Spotlight this post!  
Unread 25-05-2007, 13:03
tseres's Avatar
tseres tseres is offline
obsessed with FIRST...
FRC #1565 (Think Tank Tech)
Team Role: Leadership
 
Join Date: Apr 2007
Rookie Year: 2007
Location: Cambridge, ON
Posts: 305
tseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of lighttseres is a glorious beacon of light
Re: XBOX button

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
__________________