Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   joysticks (new) button layout (http://www.chiefdelphi.com/forums/showthread.php?t=34634)

stephenthe1 14-02-2005 15:55

joysticks (new) button layout
 
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

Re: joysticks (new) button layout
 
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

Re: joysticks (new) button layout
 
and if this isn't it, what line of code is used to fire a piston?

stephenthe1 14-02-2005 19:47

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;
}


Alan Anderson 14-02-2005 19:47

Re: joysticks (new) button layout
 
Quote:

Originally Posted by stephenthe1
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.

AIBob 14-02-2005 19:55

Re: joysticks (new) button layout
 
Quote:

Originally Posted by stephenthe1
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:
Code:

//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

Re: joysticks (new) button layout
 
Quote:

Originally Posted by stephenthe1
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

Re: joysticks (new) button layout
 
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

Re: joysticks (new) button layout
 
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


All times are GMT -5. The time now is 23:59.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi