|
Re: Programming joysticks
Quote:
|
Originally Posted by Chris Hleva
I have a question, how could I add the right lines of code to make the POV hats work with the new C language this year? Amonst other things, where would I have to define them and map them to the right IO ports to work with the hex/bin input signal?
|
example:
Code:
if( (p1_wheel & 0xC0) == 0xC0 )
{
//hat control is pushed right
}
else if( (p1_wheel & 0xA4) == 0xA4 )
{
//hat control is pushed down-left
}
...
et cetera
...
just use the bitwise AND function (&) to determine if the correct bits are set.
Last edited by deltacoder1020 : 02-02-2004 at 12:49.
|