|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
Re: Help with programming new controllers, please.
Quote:
|
|
#3
|
|||
|
|||
|
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 If there's anything else you don't understand, PM me and i'll clarify asap. |
|
#4
|
||||
|
||||
|
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 |
|
#5
|
||||
|
||||
|
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
|
|||
|
|||
|
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
|
||||
|
||||
|
Re: Help with programming new controllers, please.
Quote:
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 |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |