Go to Post Dangit Jim, we are engineers not politicians. - Andrew Schreiber [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 13-02-2004, 20:44
Richomundo's Avatar
Richomundo Richomundo is offline
Mascot
AKA: Richie Knight
#1115 (Deus Ex Machina)
Team Role: Programmer
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Santa Monica, California
Posts: 19
Richomundo is on a distinguished road
Send a message via AIM to Richomundo Send a message via Yahoo to Richomundo
problem with joystick buttons (top left one)

we are having a problem with the top left black button next to the FOV mini joystick on the joystick that FIRST has provided us.
our top right button works however....

i'm thinking maybe we dont have the correct variable. here is our code:::

/* 2nd joystick open globe motor arms */
if (p2_sw_aux1==1)
{pwm01 = 200; }
else if (p2_sw_aux2==1)
{pwm01 = 55; }
else {pwm01=127;}

the else if statement is where i think the problem is but I'm not entirely sure.
help would be helpful.
THANKS
love, richie
__________________
I got the mic and you got the moshpit
  #2   Spotlight this post!  
Unread 14-02-2004, 20:45
deltacoder1020's Avatar
deltacoder1020 deltacoder1020 is offline
Computer Guy
AKA: Dav
#1020 (The Indiana Prank Monkeys)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Muncie, Indiana
Posts: 340
deltacoder1020 has a spectacular aura aboutdeltacoder1020 has a spectacular aura about
Send a message via AIM to deltacoder1020
Re: problem with joystick buttons (top left one)

that looks correct - you can even simplify it as such:

Code:
if(p2_sw_aux1)
    pwm01 = 200;
else if(p2_sw_aux2)
    pwm01 = 55;
else
    pwm01 = 127;
__________________
Team 1020, the Indiana Prank Monkeys (www.team1020.org)
  #3   Spotlight this post!  
Unread 15-02-2004, 07:27
Ryan M. Ryan M. is offline
Programming User
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Ohio
Posts: 1,508
Ryan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud ofRyan M. has much to be proud of
Re: problem with joystick buttons (top left one)

That should work. Try reading the OI data under Dashboard and see what the values the buttons on the joystick is putting out. It may be that the button is broken. Our top right on one of the joysticks is sticky and doesn't work reliably.

In case anyone doesn't know, there is a jumper next to the dashboard port on the OI that can be moved between RC and OI. Set it to OI and you see the values coming in on the ports of the OI.
__________________

  #4   Spotlight this post!  
Unread 15-02-2004, 17:10
Richomundo's Avatar
Richomundo Richomundo is offline
Mascot
AKA: Richie Knight
#1115 (Deus Ex Machina)
Team Role: Programmer
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Santa Monica, California
Posts: 19
Richomundo is on a distinguished road
Send a message via AIM to Richomundo Send a message via Yahoo to Richomundo
Talking Re: problem with joystick buttons (top left one)

thanks every one. the problem has been solved. the joysticks are really crappy and i think both of them are broken. it wasn't the code as we thought.
gracias.
__________________
I got the mic and you got the moshpit
  #5   Spotlight this post!  
Unread 15-02-2004, 17:14
blindguyinanorg's Avatar
blindguyinanorg blindguyinanorg is offline
Matt Spencer
AKA: Sexy Beast
#1007 (Team Generals)
Team Role: Engineer
 
Join Date: Feb 2004
Location: Snellville GA
Posts: 93
blindguyinanorg has a little shameless behaviour in the past
Send a message via AIM to blindguyinanorg
Re: problem with joystick buttons (top left one)

Quote:
Originally Posted by Richomundo
thanks every one. the problem has been solved. the joysticks are really crappy and i think both of them are broken. it wasn't the code as we thought.
gracias.

open up the OI pdf file. there is a list of pinouts. the reason the button wont work is that not all the buttons are connected to a pin. if you put the joystick in port 2 the button that is not working is probably routed threw to port 3. you might want to look at the pin outs and see if this is your problem.
  #6   Spotlight this post!  
Unread 15-02-2004, 17:16
Richomundo's Avatar
Richomundo Richomundo is offline
Mascot
AKA: Richie Knight
#1115 (Deus Ex Machina)
Team Role: Programmer
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Santa Monica, California
Posts: 19
Richomundo is on a distinguished road
Send a message via AIM to Richomundo Send a message via Yahoo to Richomundo
Re: problem with joystick buttons (top left one)

Quote:
Originally Posted by blindguyinanorg
open up the OI pdf file. there is a list of pinouts. the reason the button wont work is that not all the buttons are connected to a pin. if you put the joystick in port 2 the button that is not working is probably routed threw to port 3. you might want to look at the pin outs and see if this is your problem.
we just got new joysticks.i opened one **one of the old ones** up and some wires had come off and the little green board had a crack in it.
__________________
I got the mic and you got the moshpit

Last edited by Richomundo : 15-02-2004 at 17:17. Reason: typed wrong.
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
Victor problem Andy Baker Electrical 15 24-06-2003 09:49
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
Assigning Joystick buttons.... archiver 2001 5 24-06-2002 00:59
joystick problem archiver 2000 12 23-06-2002 23:08


All times are GMT -5. The time now is 11:41.

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