Go to Post Give me a week, and a lot of caffeine and I could have one made. Problem is the lack of a week and caffeine. - Mike [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 29-11-2006, 21:20
Oumonkey's Avatar
Oumonkey Oumonkey is offline
Master of the If statement
AKA: Josh Tyus
FRC #1555 (Pulse)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Monon, IN
Posts: 50
Oumonkey has a spectacular aura aboutOumonkey has a spectacular aura about
Question Help with programming new controllers, please.

Hello,
I need help programming in new controllers for our robot. I don't know much about programming so I'm pretty confused on where to even start. The new controllers both have the right serial ports and that stuff. But they have a lot more buttons so I am not sure of how this will work. Not to mention one of them can twist so it adds a type of z-axis to it almost. But if someone can help me it would be greatly appreciated. I looked around and I didn't find anything that, I thought, helped me. But I was hoping to have some kind of answer to this by tomorrow, or Saturday, just so the higher ups don't cause pain.

Sincerely yours
Me
__________________
  #2   Spotlight this post!  
Unread 29-11-2006, 21:44
Adam Richards's Avatar
Adam Richards Adam Richards is offline
I'm baaaaaaack.
FRC #1902 (Exploding Bacon)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Orlando, FL
Posts: 1,062
Adam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond reputeAdam Richards has a reputation beyond repute
Send a message via AIM to Adam Richards
Re: Help with programming new controllers, please.

Quote:
Originally Posted by Oumonkey
Hello,
I need help programming in new controllers for our robot. I don't know much about programming so I'm pretty confused on where to even start. The new controllers both have the right serial ports and that stuff. But they have a lot more buttons so I am not sure of how this will work. Not to mention one of them can twist so it adds a type of z-axis to it almost. But if someone can help me it would be greatly appreciated. I looked around and I didn't find anything that, I thought, helped me. But I was hoping to have some kind of answer to this by tomorrow, or Saturday, just so the higher ups don't cause pain.

Sincerely yours
Me
Maximum number of controls allowed for standard gameport: 4 axes and 4 buttons. Any more than that will require specific drivers for the device, and will likely not work with the FRC RC/OI.
  #3   Spotlight this post!  
Unread 29-11-2006, 21:53
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Re: Help with programming new controllers, please.

By controllers i'm presuming you are referring to joysticks, if not, then completely disregard this.

The controlers give input to the OI, which sends whatever data you want it to sends it's data to the RC, which uses whatever data you want to use.

In the default code, under the IFI_Aliases file, IFI makes you some nice aliases for the various buttons. The obvious ones r the x and y axies, p1_x and p1_y. The number can vary based on where on the OI the controller is plugged into (port 1, 2, 3, or 4). This returns a value between 0 and 255.

The z axis, i'm guessing, is the aux wheel. On the old controllers, it was that wheel on the left side of the joystick (not the calibration one). It returns a value between 0 and 255.

Then, there are the buttons. There is a top button, and a trigger button (for all IRI is concerned, that's what they call them). There are also 2 aux buttons, which can be located anywhere (effectively). Hooking up the OI to a computer makes it easy to determine which button on the controller is which data bit. When the buttons are pressed, they return a 1, when they are not pressed, they return a 0.

And, here's a programing tip: Make your own Aliases file, call it "team#_aliases.h" and include it into your user routines file. In the aliases file, define your own aliases. For example, if the p1_y is the left drive, put this into the code:

Code:
#define STICK_LEFT_DRIVE       p1_y
Use of aliases will make life easier when trying to remember which stick does what.

If there's anything else you don't understand, PM me and i'll clarify asap.
  #4   Spotlight this post!  
Unread 29-11-2006, 22:56
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Help with programming new controllers, please.

Just put the robot up on blocks and put print statements in the code for each of the joystick variables (p1_y p1_x ...etc) and record what changes as you move the joystick.

If you have a dashboard program then you don't even need to put print statements in the code, you can just run the code with the dash board hooked up to it.

If you need more help than this let me know

James
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #5   Spotlight this post!  
Unread 30-11-2006, 16:38
Oumonkey's Avatar
Oumonkey Oumonkey is offline
Master of the If statement
AKA: Josh Tyus
FRC #1555 (Pulse)
Team Role: Programmer
 
Join Date: Jun 2005
Rookie Year: 2005
Location: Monon, IN
Posts: 50
Oumonkey has a spectacular aura aboutOumonkey has a spectacular aura about
Re: Help with programming new controllers, please.

Thanks for the help guys. It seems I won't be able to use the one joystick because it has about 6 buttons and I a few different axis. But the other is pretty simple so I'll try that first. But As for the drivers thing for joysticks, how would that work if I wanted to try?
Well thanks for all the help, I'm off to try it now.
__________________
  #6   Spotlight this post!  
Unread 30-11-2006, 21:28
Jimmy Cao Jimmy Cao is offline
Registered User
AKA: Jimmy Cao
no team
 
Join Date: Sep 2006
Rookie Year: 2004
Location: San Francisco, CA
Posts: 295
Jimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant futureJimmy Cao has a brilliant future
Re: Help with programming new controllers, please.

Adding a new driver to the RC/OI would be difficult. Somewhere in one of the default files it uses one of the data bytes from the OI which is sent in via. one of the serial ports. If you are tricky enough, it might be possible to add additional code in there (maybe?). Ive never tried, and it's unlikely I ever will.

It would be complicated at best, and impossible at worst.
  #7   Spotlight this post!  
Unread 30-11-2006, 21:53
chrisinmd's Avatar
chrisinmd chrisinmd is offline
Registered User
AKA: Chris Pickett
FRC #0888 (Robotiators)
Team Role: College Student
 
Join Date: Jan 2006
Location: Mt. Airy, MD
Posts: 83
chrisinmd is a jewel in the roughchrisinmd is a jewel in the roughchrisinmd is a jewel in the rough
Send a message via AIM to chrisinmd
Re: Help with programming new controllers, please.

Quote:
Originally Posted by Oumonkey
...It seems I won't be able to use the one joystick because it has about 6 buttons and I a few different axis...
If you really wanted to use everything on that joystick, you could make some sort of 'reverse y' to connect that joystick to two of the inputs on the OI. As Adam said, there's a maximum of 4 analog and 4 digital inputs on each port, times 4 ports, 16 analogs and 16 digitals max. Each axis of movement on the joystick is read by a potentiometer, which gives an analog value. Each button gives a digital value, 0 or 1. However, I believe the 4-way thumb-stick on the KOP joysticks gives an analog value, with a specific number for each position. I'm not 100% sure on this, though.

Last season, we made a 4 way y-splitter to connect all four CH sticks to one port, since we only wanted/needed the y-axis and one button on each joystick, that left three other ports open for anything else we wanted to put on. You would be going the other way around, connecting one stick to two ports.

Just an idea.

Good luck!
-Chris
__________________
Virginia Tech 2010!

Chesapeake Regional
Pittsburgh Regional
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
Help with animation please Waldo1641 3D Animation and Competition 7 05-02-2005 15:52
Please Help: Programming the Robovation Kit wmurphy Robotics Education and Curriculum 14 08-12-2004 12:57
Help With Delphi Please marc1718 Programming 1 16-04-2004 16:39
hey need some help with writing a code please help me here magical hands Programming 9 01-01-2004 21:46
please help with video!! Andrew Dahl Regional Competitions 0 22-03-2002 07:25


All times are GMT -5. The time now is 20:43.

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