Go to Post JVN, thanks for working with me. You will make a great MC anywhere. Folks, he actually loosened up and fit right in. - Steve W [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2008, 16:12
mayazk mayazk is offline
Registered User
FRC #2596 (FBI Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jersey city
Posts: 22
mayazk will become famous soon enough
Send a message via MSN to mayazk Send a message via Yahoo to mayazk
Joysticks question???

Hi guys


I have a question regarding the joysticks

can you program the buttons on the joysticks to functions?

thanks
__________________
Ayaz Khan
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2008, 16:19
Molten's Avatar
Molten Molten is offline
Registered User
AKA: Jason
FRC #1766 (Temper Metal)
Team Role: Mentor
 
Join Date: Dec 2006
Rookie Year: 2006
Location: Indiana
Posts: 2,289
Molten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond reputeMolten has a reputation beyond repute
Re: Joysticks question???

I'm pretty certain you can. I am almost certain that I have seen other teams do this in the past. But honestly, I am not certain. I advice you to wait for someone else to respond, but I am almost certain.
__________________
"Curiosity. Not good for cats, great for scientists."- Numb3rs

"They can break your cookie, but... you'll always have your fortune."-T.W. Turtle, Cats Don't Dance

"Tell my tale to those who ask. Tell it truly - the ill deeds along with the good, and let me be judged accordingly. The rest... is silence."-Dinobot, Beast Wars

"Though the first step is the hardest and the last step ends the quest, the long steps in between are certainly the best."
–Gruffi Gummi, Disney's Adventures of the Gummi Bears
Reply With Quote
  #3   Spotlight this post!  
Unread 11-02-2008, 16:32
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: Joysticks question???

I'm not certain what you are asking, but I'll give it a shot. I think you are essentially saying "Can I use the joystick buttons in my code?," if so, the answer is yes.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
Reply With Quote
  #4   Spotlight this post!  
Unread 11-02-2008, 16:38
mayazk mayazk is offline
Registered User
FRC #2596 (FBI Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jersey city
Posts: 22
mayazk will become famous soon enough
Send a message via MSN to mayazk Send a message via Yahoo to mayazk
Re: Joysticks question???

thank you, i understand that. But i was wondering how you program it to do something???
__________________
Ayaz Khan
Reply With Quote
  #5   Spotlight this post!  
Unread 11-02-2008, 16:44
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,113
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 question???

Code:
if (p1_sw_trig)
{
  // do something when the trigger switch on the joystick
  // connected to port 1 of the OI is pressed
}
The OI Reference Guide explains all the available joystick button names for use with the IFI default code. easyC uses a different naming convention, which is explained in the help for the functions that read OI switches.
Reply With Quote
  #6   Spotlight this post!  
Unread 11-02-2008, 16:47
SgtMillhouse648's Avatar
SgtMillhouse648 SgtMillhouse648 is offline
Registered User
AKA: Malhon Godwin
FRC #0648 (QC Elite)
Team Role: Engineer
 
Join Date: Apr 2006
Rookie Year: 2005
Location: Davenport, IA
Posts: 153
SgtMillhouse648 has a spectacular aura aboutSgtMillhouse648 has a spectacular aura about
Send a message via MSN to SgtMillhouse648
Re: Joysticks question???

Quote:
Originally Posted by mayazk View Post
thank you, i understand that. But i was wondering how you program it to do something???
Well, it's really easy, especially if you are using easyC. What they are are just digital inputs to the OI, which reads them similar to a limit switch, either a 1 or 0 depending on whether the switch is open or closed. With easyC, you can use the OI Digital Input located under the RC Control section of the interface to assign the switch to a variable. Then, you can use an If statement to program it to do something for ex., and I apologize if the format isn't correct since easyC takes care of that

if (trigger_switch == 1)

motor_output = 255;

else

motor_output = 127;


I think that's right... but it's saying if you press a button that has been declared "trigger_switch" the motor that motor_output is associated with will run full bore one direction, and if let up on the trigger, it will stop.
Malhon
__________________
2007-
Midwest Regional-
Regional Finalists with 1000 and 447
Rockwell Automation Inspiration in Control Award
Regional Woodie Flowers - Ed Wegscheid



Reply With Quote
  #7   Spotlight this post!  
Unread 12-02-2008, 15:49
mayazk mayazk is offline
Registered User
FRC #2596 (FBI Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jersey city
Posts: 22
mayazk will become famous soon enough
Send a message via MSN to mayazk Send a message via Yahoo to mayazk
Re: Joysticks question???

so the joysticks buttons can be programmed using the "if" option on easy c??
__________________
Ayaz Khan
Reply With Quote
  #8   Spotlight this post!  
Unread 12-02-2008, 16:24
SgtMillhouse648's Avatar
SgtMillhouse648 SgtMillhouse648 is offline
Registered User
AKA: Malhon Godwin
FRC #0648 (QC Elite)
Team Role: Engineer
 
Join Date: Apr 2006
Rookie Year: 2005
Location: Davenport, IA
Posts: 153
SgtMillhouse648 has a spectacular aura aboutSgtMillhouse648 has a spectacular aura about
Send a message via MSN to SgtMillhouse648
Re: Joysticks question???

Yes, your first step is to use the OI Digital input block to get the reading off the joystick. Then you can assign the button to an unsigned char variable, and then use the if statement to "test" the variable. Now, if you decide to use the thumbstick on the joystick, that is a little different, as that thumbstick is actually a four or eight (I can't remember) position analog input. for ex. If you point the stick up, you might get a reading of 90, but if you point it left, you might get a 500 or something. In that case, you will use the OI analog input, but same basic principle.
__________________
2007-
Midwest Regional-
Regional Finalists with 1000 and 447
Rockwell Automation Inspiration in Control Award
Regional Woodie Flowers - Ed Wegscheid



Reply With Quote
  #9   Spotlight this post!  
Unread 13-02-2008, 15:14
mayazk mayazk is offline
Registered User
FRC #2596 (FBI Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jersey city
Posts: 22
mayazk will become famous soon enough
Send a message via MSN to mayazk Send a message via Yahoo to mayazk
Re: Joysticks question???

can i hook up the limit switches with the joystick??

is there anyway that this is possiblE
__________________
Ayaz Khan
Reply With Quote
  #10   Spotlight this post!  
Unread 13-02-2008, 15:25
mayazk mayazk is offline
Registered User
FRC #2596 (FBI Robotics)
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Jersey city
Posts: 22
mayazk will become famous soon enough
Send a message via MSN to mayazk Send a message via Yahoo to mayazk
Re: Joysticks question???

another question

how am i suppose to connect the limit switch to the relay outputs???? what kind of wire do i need??? be specific please!
__________________
Ayaz Khan
Reply With Quote
  #11   Spotlight this post!  
Unread 13-02-2008, 16:00
SgtMillhouse648's Avatar
SgtMillhouse648 SgtMillhouse648 is offline
Registered User
AKA: Malhon Godwin
FRC #0648 (QC Elite)
Team Role: Engineer
 
Join Date: Apr 2006
Rookie Year: 2005
Location: Davenport, IA
Posts: 153
SgtMillhouse648 has a spectacular aura aboutSgtMillhouse648 has a spectacular aura about
Send a message via MSN to SgtMillhouse648
Re: Joysticks question???

You don't hook the limit switches up to the joystick, although you can, limit switches are generally ment to be hooked up to the digital input section of the robot controller via pwm style cable. You can use this the same way as the joystick. If you want to hook up a switch to the joystick, you need to do some custom wiring and hook the switch up to the appropriate pins on a DB 15 game controller plug. Here's a link with pinouts and how joysticks work: http://www.epanorama.net/documents/j..._joystick.html
Good Luck
Malhon
__________________
2007-
Midwest Regional-
Regional Finalists with 1000 and 447
Rockwell Automation Inspiration in Control Award
Regional Woodie Flowers - Ed Wegscheid



Reply With Quote
Reply


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
Question on Joysticks in Hybrid mode Commander Gix Programming 4 05-02-2008 16:38
Question about Joysticks Radiator251 Technical Discussion 12 17-08-2006 13:51
Joysticks Max Brin Technical Discussion 2 19-02-2006 12:26
AVB joysticks..and other analogue joysticks tml240 Kit & Additional Hardware 6 07-02-2004 12:45
Joysticks archiver 2001 2 23-06-2002 23:33


All times are GMT -5. The time now is 08:04.

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