|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
I know it has been done many times. I know it's often very handy. But how do you install switches and buttons on the OI? I want my robot to dump balls into the corner goals when I push a button or flip a switch. The OI, unlike the RC, does not seem to have convenient digital input connections, only serial ports. How, then, would I connect something like a three-way switch (to control a spike, for instance) to the OI? Please don't tell me to use the buttons on the joysticks. I know how to do that. I'm interested in wiring an actual switch or button to the OI. I know lots of people have done it, but how do you do it?
|
|
#2
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
Use the pinout of the serial port to make your own connector (put a switch between ground and one of the buttons).
See pages 7-10 of http://www.ifirobotics.com/docs/oi-r...e-11-21-05.pdf. |
|
#3
|
|||
|
|||
|
Re: Using Switches on the Operator Interface
Using a custom control box in addition to the drive joysticks is a great idea, we are also building one at the moment.
The pinout diagrams for the OI ports are available from IFI in the OI reference guide (they have not changed since 2005/05 I beleive) - http://www.ifirobotics.com/oi.shtml The pinout chart gives the pin number for the OI digital and analog inputs, as well as the LED feedback drivers, and the IFI aliases for those inputs/outputs. You will need 15 pin solder cups [male and female] and some basic wiring skills, but its quite simple to do. For switches - wire them between the input pin and any ground pin of that port. good luck, have fun. |
|
#4
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
So as not to confuse the reader, the 15 pin connectors on the OI are gameports not serial ports. They are compatible with the oldstyle game port joysticks found on PC's from long ago. (In computer years, that is.)
|
|
#5
|
|||
|
|||
|
Re: Using Switches on the Operator Interface
Quote:
|
|
#6
|
|||
|
|||
|
Re: Using Switches on the Operator Interface
Can someone please give me a less technical explanation of what everyone said about the pinouts and so on? I may be an experienced computer programmer, but I am fairly close to a newbie at robot programming. I'm not sure I know anything about the pins in the gameports.
|
|
#7
|
||||
|
||||
|
Re: Using Switches on the Operator Interface
Quote:
|
|
#8
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
The 15 pin connector that goes to a joystick - each pin corresponds to a particular function in the program. The document linked to earlier has the pinout description of what each does. To use a digital switch, for example, connect one terminal of the switch to ground and the other to one of the pins that corresponds to, say, p1_sw_trig (assuming your switchbox is plugged into port 1).
Then, in the program, whenever you access p1_sw_trig, you are actually getting the value of your switch. |
|
#9
|
|||
|
|||
|
Okay, that works. Now what if I have a multi-way switch? Can I plug it into the pin corresponding to p4_x, let's say, under port 4, and get a value from 0 to 255, where 0 will be one position, 1 will be another, and 2 will be another? And how will the switch know which position should be 0 and which should be 2? Or is it going to return 1,0, and -1, thus throwing my unsigned char data type off balance?
|
|
#10
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
Well, p4_x is an analog variable, so you'd have to rig up some resistors in varying amounts to get different values for the switch positions. (I'm not entirely sure on the values of the resistors, so I won't guess.) Alternatively, you could wire it to two different digital inputs.
|
|
#11
|
|||
|
|||
|
Re: Using Switches on the Operator Interface
So, in a word, to get a binary switch working, I can simply wire it to the right pins, but to get a 0-255 thing working (analog), I'm actually going to have to build resistors or get potentiometers?
|
|
#12
|
||||
|
||||
|
Re: Using Switches on the Operator Interface
Correct.
|
|
#13
|
|||
|
|||
|
Well, I think I'll just wire several binary switches and ask the computer to compute values using binary. Like if I want to select between 4 things, I'll convert input from 2 binary switches to a number from 0-3, and attach a printed label sheet to the operator interface so my team members can know what's going on. No problem, I guess. Binary math is easy.
|
|
#14
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
Quote:
Last season, I was field coach for 1293 during their short (two-match, if I recall) reign as #1 seed at Palmetto. I wasn't even doing the driving, and my mind had a million things going (time remaining, which goals were ours, which goals needed to be ours, is anyone in the loading zones, et cetera). Trying to throw in much of any sort of math would've had dire consequences. The general thing you'll see on most OI panels is that they're simple. A driver should be able to judge what's going on by touch or a brief glance. This, in turn, gives them more time to figure out how to do more important things, like moving around those two 120-pound hunks of machinery blocking your path to the goal. (Of course, if your two switches corresponded to something visual on the robot, such as a left and right ball sucker, then by all means go for it.) That said, binary is perfectly fine on the robot side for things like setting an autonomous mode. Even the most tense field coach in the world can figure that sort of thing out. Hope this helps! |
|
#15
|
|||||
|
|||||
|
Re: Using Switches on the Operator Interface
Quote:
Last year, we decided that to make driver reaction faster, we would only use momentary large (coin op arcade-style) push buttons on our operator interface (besides the joysticks of course). We would then use code to make them emulate toggle switches. (Such as hit it once to start a function, and hit it again to stop it). This may not be perfectly suited for every application, but I can tell from experience (I was the co-driver for my team last year), that not having to look down at the button when you push it really helps. As you can see, our 2005 operator interface was about as simple at you could get. ![]() ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Alternative to limit switches? | RbtGal1351 | Electrical | 27 | 10-12-2005 15:30 |
| Robot Cart Switches | Chaos204 | Electrical | 6 | 23-06-2005 20:57 |
| limit switches | stephenthe1 | Programming | 28 | 11-05-2005 16:37 |
| Team selector switches on ISAAC | Lloyd Burns | Robotics Education and Curriculum | 0 | 17-12-2002 08:32 |
| Need help with custom switches | archiver | 2001 | 3 | 24-06-2002 00:35 |