This is what I have? I haven't done anything with turning the robot to the correct degree, I'm not very good at this stuff and I'm the only programmer and electrician on the whole team of 5, so i'd really like some help. Here is what I have for this:
Code:
if(Get_Camera_State() == 1)
{
if((Get_Tracking_State() == CAMERA_ON_TARGET) && (Find_Distance > set closest range)
{
pwm01 = desired forward velocity;
pwm02 = same forward velocity;
Switch3_LED = 1;
}
else if((Get_Tracking_State() == CAMERA_ON_TARGET) && (Find_Distance() <= set closest range))
{
pwm01 = 127;
pwm02 = 127;
Camera_Idle(); //Sets Camera in OFF mode so manual mode can continue.
Switch3_LED = 0;
}
else
{
Switch3_LED = 0;
}
Does any of this make sense? I think that Camera_Idle() will stop the whole process of moving the camera around, right? Later I have a button that I press that calls the Restart_Camera funciton which I think undoes the Camera_Idle() process, right? wrong? some help would be great. Also, will this work with moving the robot forward while the CAMERA is on target and the range (Find_Distance) is greater than the range that we want to be at when the robot stops. It looks to me like it would make sense but I realyl don't know what I'm doing. Thanks a bunch everybody.