Quote:
Originally Posted by John Hooper
I have MPLAB 8.1, compiler 3.1 set up with Kevin Watson's FRC code, which does compile.
|
Open up teleop.c in your editor. The one function you really need to know about is Teleop(). During teleoperation mode this function is called when new data has been received from the operator (i.e., robot driver) interface, which has a bunch of joysticks attached. This happens every ~26ms. The idea is to take the driver's input and use it to control a motor. The simplest case would be something like:
pwm07 = p1_y;
This maps the y-axis of the joystick attached to port one of the operator interface to the motor controlled by PMW output seven. The variables are unsigned chars where neutral is 127, full reverse is 0, and full forward is 255. pwm07 and p1_y are #defined in ifi_frc.h. The default mapping that has been used in the past can be found in ifi_code.c/Default_Routine().
-Kevin