|
|
|
![]() |
|
|||||||
|
||||||||
|
|
Thread Tools | Rate Thread | Display Modes |
|
#21
|
||||||
|
||||||
|
Re: What are we supposed to do!?!?!?!??!?!
Quote:
The Default code is a real mess in my opinion. It is a mix-mash of a bunch of legacy stuff from the early years of FIRST and a bunch of patches and band -aids applied to add new features and functions. Here is the basic idea: Inputs from the Operator Interface (OI) come from 4 ports -- they themselves are legacy 15 pin game ports from the early days of the IBM PC. Each port has switches and analog inputs. The switches are defined this way: pN_sw_SWITCHNAME where N refers to the port number and SWITCHNAME refers to "top", "trig", "aux1" and "aux2" Depending on what brand joystick you use these switches will be available out of the box or not -- if not, and you need those switches, you will have to build a custom harness to get access to the switches. The default code has structures and aliases defined for you that allow you to treat these switches as either 1 or 0's The analog inputs are defined this way: pN_ANALOGNAME where N refers to the port number and ANALOGNAME Refer to "X" "Y" "WHEEL" and "AUX" Again depending on what brand joystick you use these analog inputs will be available out of the box or not -- if not, and you need those inputs, you will have to build a custom harness to get access to the analog inputs (wiring in your own potentiometer for example). The default code has structures and aliases defined for you that allow you to treat these analog inputs as either a number between 0 and 255 -- with 127 being the nominal center position of the joystick. You have similar naming conventions for inputs on the Robot Controller's analog and digital inputs. The outputs on the RC are basically the PWM values 0-254 and relays (which are of the form rc_dig_outNN). In order to control a motor, you just assign the PWM output to a value 0 = full rev, 127 = off, 254= full fwd. The default code simply maps joystick values from the OI to PWM outputs on the RC. It also has some example methods of mapping limit switches to particular PWM output so that the motor will turn off when an end of travel switch is made. If you know C and you know how to access the various inputs and outputs, you should be able to write code to let your robot do what ever you need it to do. Good luck. Joe J. |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| What are Potentiometers? | Theory6RobotiX | Control System | 18 | 30-12-2005 09:57 |
| PBASIC 2.5 Software supposed to be released TODAY. | Travis Hoffman | Programming | 7 | 13-01-2003 20:43 |
| What are pneumatics? | Aignam | Pneumatics | 23 | 16-10-2002 21:17 |
| Who was supposed to be in Huntington?? | Heather 45 | Off-Season Events | 4 | 16-03-2002 22:43 |