View Full Version : joysticks (new) button layout
stephenthe1
14-02-2005, 15:55
does anyone know where I can find information on accessing the different buttons on this year's joysticks? there are 3 "thumb buttons" on the top of it, I need to know how to access the left one and the right one (not the center one). they are circular in shape.
stephenthe1
14-02-2005, 16:07
ok, actually they are the aux. buttons. (correct me if I'm wrong about the buttons' names). We're changing gears in our trans. with two pistons. I've never used pistons before. I'm pretty sure I just say "relay1_fwd = 1; and relay1_rev = 0;"" for the foward position and "relay1_rev = 1; and relay1_fwd = 0;" for the reverse. is this correct?
stephenthe1
14-02-2005, 17:53
and if this isn't it, what line of code is used to fire a piston?
stephenthe1
14-02-2005, 19:47
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:
//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;
}
Alan Anderson
14-02-2005, 19:47
ok, actually they are the aux. buttons. (correct me if I'm wrong about the buttons' names). We're changing gears in our trans. with two pistons. I've never used pistons before. I'm pretty sure I just say "relay1_fwd = 1; and relay1_rev = 0;"" for the foward position and "relay1_rev = 1; and relay1_fwd = 0;" for the reverse. is this correct?
That is correct if your piston is connected to the outputs of a dual solenoid being controlled by a Spike connected to relay output 1.
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:
You shouldn't need the extra variables.
When pushed the variables are set, when the button is released, the variable is unset.
You do not need to check if it '==1', you can just have it like so:
//transmission
if (p3_sw_trig)
{
relay1_fwd = 1;
relay1_rev = 0;
}
if (p3_sw_aux2)
{
relay1_fwd = 0;
relay1_rev = 1;
}
Alan Anderson
14-02-2005, 20:06
what code is used to reference the thumb button on the "side" of the joystick?
That's connected to the "top" button input, p#_sw_top.
stephenthe1
14-02-2005, 20:46
oops, I posted the wrong relay number, I meant #7. thanks for the advice. that makes a lot of sense.
thank you,
Stephen
stephenthe1
16-02-2005, 15:28
I need to know something:
what is the code for accessing the click event of the top (side button) on the joystick and the trigger click event for a joystick in port 1.
the same for port 2.
will I have to disable certain buttons on the ui? I know some buttons won't work at the same time another is set up. does the default code support accessing these ports and buttons? this has been plagueing me for a couple days now, and it's rather urgent that we figure this problem out. thank you so much. if you could reply quickly, I would be very very very thankful.
thanks,
Stephen
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.