Go to Post Of course this should be your decision- not the FIRST community's. Take charge of your destiny. - Wayne C. [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-2003, 09:23
EniJenni EniJenni is offline
Registered User
#0825
 
Join Date: Jan 2003
Location: Southwest Virginia Governor's School
Posts: 3
EniJenni is an unknown quantity at this point
Joystick Wheels

Hey!

Alright, we need another button or something else to accuate another cylinder. Unfortunately, pneumatics have taken up all the buttons and triggers except for the wheels on the joysticks. So basically, the question I have is, if we want to use the wheels, do we change the p1_wheel = p1_wheel MAX 127 in the default code?? How do we even program the wheels on the joystick? We are so confused! Please someone help!

~Jenni~
  #2   Spotlight this post!  
Unread 13-02-2003, 09:34
rbayer's Avatar Unsung FIRST Hero
rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Unlike the buttons, the wheels are analog controls that will have a value between 0 and 254, with 127 being the middle. Based on the fact that you are going to be controlling relays with them, you only need to know whether the wheel is greater than 127 or less than it. The following code will accomplish this:

relayX_fwd = p1_wheel / 127
relayX_rev = 1 - relayX_fwd

This works because of the way integer math rounds things off. (ie 200/127=1 and 50/127 = 0). The second line is there to make sure that the relay is either in forward or reverse, but not both. If you are using the big Festo single solenoid, you can (and should) get rid of the second line.

With this code, whenever the wheel is at or above the middle, the cylinder will go one way. When it is below, it will go the other. Let me know if you were looking for something different.


--Rob
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php
  #3   Spotlight this post!  
Unread 13-02-2003, 09:47
PyroPhin's Avatar
PyroPhin PyroPhin is offline
Registered User
None #0263
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Frozen Wasteland, NY
Posts: 68
PyroPhin is on a distinguished road
the ammount of buttons available to you on the OI is next to limitless. you will do yourselves and your team a great favor if you use actual buttons on your panel versus the buttons/wheels on the sticks. my teams experience is that the chance of accidentally hitting the joystick buttons is quite high.

to add your own buttons is really simple.

the InnovationFIRST website has the pinout of the OI ports and you can very simply connect a button between a input pin and a ground to trigger a variable.. Example:

port 3:
pin 2 and pin 4 triggers the p3_sw_trig variable to a 1
and a 0 when the pins arent connected.

this is what the pin is aliased to in the default code.. yours may be different.

do yoursleves a favor, read the IFI Full size RC users manual, will explain this in detail for you

~Pyro
__________________
Squee!
-=-=-=-==-=-=-=-==-=-=-==-
Team 263, Aftershock:
Alumni, guy who comes back and fixes Krass's mistakes
  #4   Spotlight this post!  
Unread 13-02-2003, 10:35
EniJenni EniJenni is offline
Registered User
#0825
 
Join Date: Jan 2003
Location: Southwest Virginia Governor's School
Posts: 3
EniJenni is an unknown quantity at this point
rbayer~
Thank you so much! Now something actually works, and we can say we actually have something to show for our time today!


Pyrophin~
I'm really sorry if we wasted your time by asking a question that could easily be found in the manual. We are not very experienced programmers, and the manual makes no sense to us. Therefore, we rely on you guys to help us with what we don't understand. We really are trying to understand more and try to bother you seasoned programmers as little as possible. Once again, sorry if we inconvenienced you in anyway.

~Jenni~
  #5   Spotlight this post!  
Unread 13-02-2003, 11:56
ChrisH's Avatar Unsung FIRST Hero
ChrisH ChrisH is offline
Generally Useless
FRC #0330 (Beach 'Bots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1998
Location: Hermosa Beach, CA
Posts: 1,230
ChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond reputeChrisH has a reputation beyond repute
EniJenni,

Helping is mostly what we are here for, don't let PyroPhin put you off. I can tell from your team number that you are on a second year team. It really takes at least four to five years for a team to get it's act together.

Yes, the info you needed was in the manual, but there is often a certain level of expertise needed to realize that the answer to your question is sitting in front of you. You see the answer, you just don't comprehend it.

Last night I was working in one of our sponsors machine shop. Now I've been around shops for more than twenty five years, but last night I saw something on a table I'd never seen before. I didn't know what this strange object was so I asked about it. It was a thread file. You use it to clean up threads cut on a lathe. Just the thing for the job and I could tell by looking that it would work in that application. But until I was told, I had no idea what I was looking at or that it was an elegant solution to a problem.

Unfortunately it was not the problem I was working to solve.


So keep asking questions and someday you too will be giving the answers
__________________
Christopher H Husmann, PE

"Who is John Galt?"
  #6   Spotlight this post!  
Unread 13-02-2003, 23:05
PyroPhin's Avatar
PyroPhin PyroPhin is offline
Registered User
None #0263
 
Join Date: Feb 2002
Rookie Year: 2002
Location: Frozen Wasteland, NY
Posts: 68
PyroPhin is on a distinguished road
im sorry..

just wanted to apologize if i came off the wrong way, i meant no offense to you and your team. perhaps i could have worded my response a bit better.

the manual is a great sounce of information on the OI and gives you the information you need to pretty much build anything you can think of. if you have any questions on it's contents or need something explained feel free to Message me, be more than happy to assist you >>: )

AIM - Audiocomputerpri

or just drop me a message on the Chiefdelphi thingie

~Pyro
__________________
Squee!
-=-=-=-==-=-=-=-==-=-=-==-
Team 263, Aftershock:
Alumni, guy who comes back and fixes Krass's mistakes
  #7   Spotlight this post!  
Unread 14-02-2003, 23:11
jacob_dilles's Avatar
jacob_dilles jacob_dilles is offline
Registered User
AKA: theshadow
FRC #0620 (WarBots)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Vienna, VA
Posts: 245
jacob_dilles will become famous soon enough
Send a message via AIM to jacob_dilles
Ok well questions ARE good, so don't stop asking them... BUT this thread is about extra inputs. We just got through that, so I have some insight that might be useful...

I see 4 ways to do what you need to do:

1) The "Cheap" way, but you may consider it the best. Ive been doing this for a long time so I would detest my team doing it. Basically you put a second joystick on port 2 and use those buttons.

2) This is a little more difficult. If its just one pneumatic piston, I'm assuming its on a double solenoid valve. That means you only need one or two buttons, depending on how the programing is written. You could go to radioshack and buy two (or one) NO (normally open) pushbutton switches for less then $2. If you don't like buttons you could do the whole thing with one STSP toggle switch (i.e. a "1" is up and a "0" is down"). Then you get a small plastic enclosure for another $2. A male DB15 connector (for use with cable) or female DB15 connector (no cable) runs for less then a buck. Finally, make sure you have rosin-core solder and a pencil iron (>30W is a GOOD thing). The whole thing will take about 2 hours to assemble with no experience, or about 15 minutes if you know what your doing. The whole apparatus plugs into PORT2.

3) This is similar to solution #2, but a little more complicated. BY SPEC, a standard joystick port has 2 sets of x and y, and 4 buttons. In the (crummy) joysticks that FIRST provides us with, they use X1 and Y1 in the handle, and Y2 on the wheel (might wanna check me on that, I'm doing this from memory). They use buttons 1 and 2. That leaves open X2, button 3 and button 4 for your use. Theres a couple of problems with this, however. The cable that comes with the stick has only the pins (and wires) that they use, which would mean you would have to put on a new cord. Second, it is not clearly documented how to get to buttons 3 and 4 from the RC code; I think that it is AUX1 and AUX2, but I could be wrong. And finally, you have to be pretty good at taking stuff apart (experience DOES matter) because theres a lot of flimsy stuff in there and is VERY easy to mess up. Well actually I take that back, its a well build joystick, and with the relatively open construction it has been one of the easiest mods Ive ever done...

4) This is going to be the fastest, and if you look in the right place, the cheapest. BUY A DIFFERENT JOYSTICK!

Well that sums that up. You probably aren't going to use #2 or #3 but hopefully someone else will find this thread useful; as I put almost as much work into the descriptions as I did the mods... ; )

If anyone has any questions, feel free to email me at theshadow2754@hotmail.com

thanks, Jacob
  #8   Spotlight this post!  
Unread 14-02-2003, 23:28
DanLevin247 DanLevin247 is offline
Missing In Action
#0247 ('da bears)
Team Role: Alumni
 
Join Date: May 2002
Location: Berkley Michigan
Posts: 494
DanLevin247 is on a distinguished road
Send a message via AIM to DanLevin247
Quote:
Originally posted by PyroPhin
the ammount of buttons available to you on the OI is next to limitless. you will do yourselves and your team a great favor if you use actual buttons on your panel versus the buttons/wheels on the sticks. my teams experience is that the chance of accidentally hitting the joystick buttons is quite high.
~Pyro


....Which is exactly why we have a saftey programed into the driver's joystick. In order for the desired action to be perfromed, either the trigger or the top button must be held in and the remaining button can then be pressed. Much like a "saftey" on a gun.
__________________
'daaaaaaaaaaaaaa bears!

~~~~~~~~~~~~~~~~~~~~~~

It's all fun and games till someone gets hurt.....then it's hillarious!
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
What do you use for wheels? Andrew Technical Discussion 36 08-01-2004 10:20
robot goes haywire with the one joystick default code Miles Programming 7 24-01-2003 14:58
Lots of Wheels and F = u x N archiver 2001 17 23-06-2002 23:37
joystick problem archiver 2000 12 23-06-2002 23:08
"Motors and Drive train edition" of Fresh From the Forum Ken Leung CD Forum Support 6 29-01-2002 12:32


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

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