View Single Post
  #2   Spotlight this post!  
Unread 27-01-2007, 19:43
divergentdave divergentdave is offline
Registered User
FRC #1816 (Green Machine)
 
Join Date: Jun 2006
Rookie Year: 2007
Location: MN
Posts: 35
divergentdave is a jewel in the roughdivergentdave is a jewel in the roughdivergentdave is a jewel in the rough
Send a message via AIM to divergentdave
Re: Direct Joystick Access

Coincidentally, I was struggling with these same problems mere hours ago.

Last things first, you need to define the preprocessor macro _FRC_BOARD via Project->Build Options->Project->C18 tab->Add macro definition. This is because most of the definitions in API.h are inside #ifdefs that check whether it should include VEX or FRC versions of all the functions.


As for the joystick buttons, I believe the function is named GetOIDInput for the buttons and GetOIAInput for joystick axes, so for the trigger button on joystick 1, you would call GetOIDInput(PORT_1, TRIGGER_SW). (disclaimer: this is off the top of my head, I don't have the code in front of me)
__________________
Team 1816 - The Green Machine