View Single Post
  #4   Spotlight this post!  
Unread 14-02-2005, 19:47
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Re: joysticks (new) button layout

wow, I feel like I'm talking to myself. um, could you tell me if you see any problems with this code (it fires a piston when the trigger is pressed, or if the aux. button is pressed). what code is used to reference the thumb button on the "side" of the joystick? I tried this code and it wouldn't work for some reason. do I need these extra variables? I wasn't sure if the buttons "remember" that they were pressed. but it shouldn't matter anyways. should I place this code in user_routines_fast(), or user_routines()? thanks for all the help. here's the code I'm having trouble with:

Code:
//transmission

static int trig_pulled = 0;
static int thumb_pressed = 0;
if (p3_sw_trig == 1)
{
thumb_pressed = 1;
trig_pulled = 0;
}
if (p3_sw_aux2 == 1)
{
trig_pulled = 1;
thumb_pressed = 0;
}

if (thumb_pressed == 1)
{
relay1_fwd = 1;
relay1_rev = 0;
}
if (trig_pulled == 1)
{
relay1_fwd = 0;
relay1_rev = 1;
}