Quote:
Originally Posted by teh_pwnerer795
How would i do that? ..
|
In user_routines.c in Kevin Watson's "bells and whistles" version of his camera code (which you are probably using if you are calling Servo_Track()) there is this code:
Code:
// This function reads data placed in the T_Packet_Data
// structure by the Camera_Handler() function and if new
// tracking data is available, attempts to keep the center
// of the tracked object in the center of the camera's
// image using two servos that drive a pan/tilt platform.
// If the camera doesn't have the object within it's field
// of view, this function will execute a search algorithm
// in an attempt to find the object.
if(tracking_menu_active == 0)
{
Servo_Track();
}
You are looking at the last bit there. That code checks if the code in terminal.c (I think) has set the tracking_menu_active variable to 0; if it has, it calls Servo_Track(). What you want to do is modify the line two lines above Servo_Track(); to read something like:
Code:
if((tracking_menu_active == 0)&&(whatever condition you want here))
where "whatever condition you want here" is replaced by what you want your code to check to see if it should call Servo_Track(). You could have a variable, for instance, called jbotRulesTheWorld (hey, I just had to add that

) and you want your code to call Servo_Track() if jbotRulesTheWorld equals 1. You would write:
Code:
if((tracking_menu_active == 0)&&(jbotRulesTheWorld == 1))
in place of the original
Code:
if(tracking_menu_active == 0)
Good luck, and if you need more help don't hesitate to post back here.
JBot (rules the world...

)
EDIT: Oh, well Chris31 beat me to it. I'll still leave this post here for clarity.