View Single Post
  #2   Spotlight this post!  
Unread 08-02-2007, 17:17
marccenter's Avatar
marccenter marccenter is offline
Registered User
FRC #3548 (RoboRavens2)
Team Role: Coach
 
Join Date: Sep 2004
Rookie Year: 2004
Location: Royal Oak
Posts: 406
marccenter has a spectacular aura aboutmarccenter has a spectacular aura about
Re: Using kevin's code for driving and camera tracking

Here's what I have done so far. I have reassigned the
joystick #1 y-axis parameter (p1_y) to go directly
to pwm03 and pwm04. You can see that I have commented
out the calls to pwm01 and pwm02 since we are using
them also for the camera. Since pwm03 and pwm04
are the same value, the drive motors must be set up
so that they both drive in the same direction when
connected. I hope this helps. I haven't tried it yet
in our robot, but I think it should work.

/*---------- Analog Inputs (Joysticks) to PWM Outputs-----------------------
*--------------------------------------------------------------------------
* This maps the joystick axes to specific PWM outputs.
*/
//pwm01 = p1_y; /* Camera Pan Servo */
//pwm02 = p2_y; /* Camera Tilt Servo */
pwm03 = p1_y; /* was pwm03 = p3_y */
pwm04 = p1_y; /* was pmw04 = p4_y */
__________________
Marc Center
FIRST FRC Mentor/Coach - Team 3548 Royal Oak RoboRavens#2 - on Sabbatical 2017 season
marc.center@gmail.com
Mobile: 248-255-7377