will this work to follow an object and when its too close to turn?
//object on left
if(scan_angle > 57 && sharp_IR_reading > scan_thresh)
//object on right
else if(scan_angle < 41 && sharp_IR_reading > scan_thresh)
// object at close distance
else if(sharp_IR_reading == scan_thresh)
//object is centered
else if(sharp_IR_reading > scan_thresh && scan_angle >41 <57)
can anyone find any errors or if this would work as an idea?