Re: TI-H: Joystick Link port


[Prev][Next][Index][Thread]

Re: TI-H: Joystick Link port





A little tip, the joysick will suck if you have it like that. You will 
have no way to let the calc know the joystick is not being presses and 
there are no angles, plus you might as well add a fire button or two!

Here's how

1 start bit
1 stop bit
6 data bits to represent the joystick position and the buttons.

bit number
1 2 3 4 5 6 actual joystick position
________________________________

0 0 0 0 0 0 center, no buttons       
1 0 0 0 0 0 center, button 1
0 1 0 0 0 0 center, button 2
1 1 0 0 0 0 center, button 1 & 2

0 0 1 0 0 0 up, no buttons       
1 0 1 0 0 0 up, button 1
0 1 1 0 0 0 up, button 2
1 1 1 0 0 0 up, button 1 & 2

0 0 0 1 0 0 down, no buttons       
1 0 0 1 0 0 down, button 1
0 1 0 1 0 0 down, button 2
1 1 0 1 0 0 down, button 1 & 2

0 0 0 0 1 0 left, no buttons       
1 0 0 0 1 0 left, button 1
0 1 0 0 1 0 left, button 2
1 1 0 0 1 0 left, button 1 & 2

0 0 0 0 0 1 right, no buttons       
1 0 0 0 0 1 right, button 1
0 1 0 0 0 1 right, button 2
1 1 0 0 0 1 right, button 1 & 2

0 0 1 0 1 0 up left, no buttons       
1 0 1 0 1 0 up left, button 1
0 1 1 0 1 0 up left, button 2
1 1 1 0 1 0 up left, button 1 & 2

0 0 1 0 0 1 up right, no buttons       
1 0 1 0 0 1 up right, button 1
0 1 1 0 0 1 up right, button 2
1 1 1 0 0 1 up right, button 1 & 2

0 0 0 1 1 0 down left, no buttons       
1 0 0 1 1 0 down left, button 1
0 1 0 1 1 0 down left, button 2
1 1 0 1 1 0 down left, button 1 & 2

0 0 0 1 0 1 down right, no buttons       
1 0 0 1 0 1 down right, button 1
0 1 0 1 0 1 down right, button 2
1 1 0 1 0 1 down right, button 1 & 2

Sorry if it looks like a lot, but that's what's required for the 
joystick and 2 fire buttons. Even cutting 1 or both of the fire buttons 
out won't do much for you. You still have 4 bits of actual data. the 
catch is, unless you add 32 buttons, is that you must have an extra bit 
or it won't recognize center. It'll think something is pressed even when 
it's not. I supose the start bits can handle that problem, but this 
method is expandible and can be done with just an 8-bit shift register. 
Connect bit 0 and 7 to 5v or ground (whichever is used) and then the two 
buttons to bit 1&2, and the switches for the joystick to bits 3-6.

Simple!

Richard Piotter
richfiles1@hotmail.com



>The data coming in is (obviously) serial data, 2 start bits, 2 actual
>joystick bits, 1 stop bit.
>
>1st      2nd               actual joystick bit
>   1         1                     up
>   1         0                     down
>   0         1                     left
>   0         1                     right
>
>Thanks a lot, let me know if any changes need to be made, it shouldn't 
be
>very hard.

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com