Quote:
|
Originally Posted by Tom Bottiglieri
The solution I came up with is to make a simple counter that keeps track of program loops and moves the servo until it finds a color.
Code:
int counter = 0; //counter variable
if(camera_find_color(GREEN) == 0)
{
camera_set_servos(counter, 127); //move pan servo 1 PWM value 40 times a second
}
else camera_auto_servo(1); //stop pan loop
//Increment counter.
if(counter < 255)
{
counter++;
}
else counter = 0;
|
Hi! I really like your code and that was something that simmilar to what our team came up with. Infact our code wasn't as successful as yours but anyways thanks for the code. I just want to mention that their is a problem with the code or our cam configuration because when i put your code into autonomous mode it shows Error in terminal window stating "*Error setting color tracking parameters Expected 8, and got 0" You know what is the reason behind it maybe? Me and my team truly appreciated your help thanks once again!