View Single Post
  #2   Spotlight this post!  
Unread 18-01-2008, 22:07
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
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.