|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
|||
|
|||
|
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?
|
|
#3
|
|||
|
|||
|
Re: joysticks (new) button layout
and if this isn't it, what line of code is used to fire a piston?
|
|
#4
|
|||
|
|||
|
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;
}
|
|
#5
|
|||||
|
|||||
|
Re: joysticks (new) button layout
Quote:
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;
}
|
|
#6
|
|||||
|
|||||
|
Re: joysticks (new) button layout
Quote:
|
|
#7
|
|||
|
|||
|
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 |
|
#8
|
|||
|
|||
|
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 |
|
#9
|
|||||
|
|||||
|
Re: joysticks (new) button layout
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| number of joysticks | Waste | General Forum | 21 | 27-01-2005 15:04 |
| disabling a button | gomez6760 | Programming | 1 | 12-08-2004 11:54 |
| need joysticks! | Tom Bottiglieri | General Forum | 14 | 24-02-2004 09:36 |
| AVB joysticks..and other analogue joysticks | tml240 | Kit & Additional Hardware | 6 | 07-02-2004 12:45 |
| which button machine do you use and do you like it? | KenWittlief | General Forum | 10 | 16-10-2003 00:01 |