View Single Post
  #18   Spotlight this post!  
Unread 17-01-2007, 10:25
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: CMUCam, Easy C, and Labview

The SetServoTracking command is the same as SetPWM but for the camera servos. If you want to have the camera auto target like it would if the servos were plugged into the camera then do this.

Code:
void Initialize ( void )
{
     InitCamera ( 1 ) ;   //Initialize camera for target color
     SetServoTracking ( 1 , 1 ) ; // Sets camera servos to autotrack target
     StartCamera ( ) ; // You need to restart the camera if you change camera servo settings
}



void OperatorControl ( void )
{
      unsigned char ServoPan; 
      unsigned char ServoTilt; 

      SetServoTracking ( 1 , 1 ) ; // Sets camera servos to autotrack target
      StartCamera ( ) ; // You need to restart the camera if you change camera servo settings
       
      while ( 1 )
      {
            // Checks the where the camera wants the servos to be pointed.
            CaptureTrackingData ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , &ServoPan , &ServoTilt ) ;
            SetPWM ( 1 , ServoPan ) ; // Moves the servo for Pan
            SetPWM ( 2 , ServoTilt ) ; // Moves the servo for Tilt
      }
}
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni