View Single Post
  #3   Spotlight this post!  
Unread 01-02-2007, 21:26
Jon Anderson's Avatar
Jon Anderson Jon Anderson is offline
Registered User
no team
Team Role: Programmer
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Indiana
Posts: 84
Jon Anderson is a glorious beacon of lightJon Anderson is a glorious beacon of lightJon Anderson is a glorious beacon of lightJon Anderson is a glorious beacon of lightJon Anderson is a glorious beacon of light
Send a message via AIM to Jon Anderson
Re: using servos with camera

Quote:
Originally Posted by team877 View Post
and also when the robot gets to the light how can you make the robot stop
The way that we're stopping our robot in autonomous mode is having the our motors stop once the tilt servo on our camera reads a certain amount, in our case it's currently at 200. Your code look roughly something like the following:

Code:
if (TILT_SERVO > 190) 
{
   LEFT_DRIVE = 127;
   RIGHT_DRIVE = 127;
}
TILT_SERVO being which ever output you choose (it's pwm slot 2 for the default Kevin code), and LEFT_DRIVE, RIGHT_DRIVE being their own respective pwms.