Go to Post It's always nice to have the outside party take a look at your code because one of two things can happen: 1. They write it better. 2. They find your stupid mistake. - [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-02-2005, 15:55
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
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   Spotlight this post!  
Unread 14-02-2005, 16:07
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

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   Spotlight this post!  
Unread 14-02-2005, 17:53
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

and if this isn't it, what line of code is used to fire a piston?
  #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;
}
  #5   Spotlight this post!  
Unread 14-02-2005, 19:47
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
  #6   Spotlight this post!  
Unread 14-02-2005, 19:55
AIBob's Avatar
AIBob AIBob is offline
AI Programmer
AKA: Bob Frank DOT org
FRC #0358 (Hauppauge Robotic Eagles)
Team Role: Alumni
 
Join Date: Jan 2005
Rookie Year: 2003
Location: Long Island, NY (in Binghamton now)
Posts: 297
AIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to beholdAIBob is a splendid one to behold
Send a message via ICQ to AIBob Send a message via AIM to AIBob Send a message via MSN to AIBob Send a message via Yahoo to AIBob
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;
}
__________________
- from B B frank

  #7   Spotlight this post!  
Unread 14-02-2005, 20:06
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,112
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
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.
  #8   Spotlight this post!  
Unread 14-02-2005, 20:46
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

oops, I posted the wrong relay number, I meant #7. thanks for the advice. that makes a lot of sense.
thank you,
Stephen
  #9   Spotlight this post!  
Unread 16-02-2005, 15:28
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

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
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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


All times are GMT -5. The time now is 09:26.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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