|
Re: Testing for bits in EasyC
Paul recommend we use
dpad_top = (GetOIAInput ( 1 , 3 )&1<<7)?0:1 ;
dpad_bottom = (GetOIAInput ( 1 , 3 )&1<<6)?0:1 ;
dpad_left = (GetOIAInput ( 1 , 3 )&1<<5)?0:1 ;
dpad_right = (GetOIAInput ( 1 , 3 )&1<<4)?0:1 ;
left_top = (GetOIAInput ( 1 , 4 )&1<<7)?0:1 ;
right_top = (GetOIAInput ( 1 , 4 )&1<<6)?0:1 ;
left_trigger = (GetOIAInput ( 1 , 4 )&1<<5)?0:1 ;
right_trigger = (GetOIAInput ( 1 , 4 )&1<<4)?0:1 ;
I'm not sure how to properly define this so the compiler does barf but if you can do it in C you can do it in easyC
edit: I got it to work I think...
Click on the projects tab and paste:
#define BUTTON_5 ((~GetOIAInput ( 1 , 3 ) &0x80)!=0) // same as p1_wheel
Into UserInclude.h
Also the Xbox controller itself isn't the best unit the thumbsticks stick and don't recenter well. The Logictech "PS2" like controller works better.
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Last edited by Kingofl337 : 18-01-2008 at 22:18.
|