while(True):
clock.tick() # Track elapsed milliseconds between snapshots().
img = sensor.snapshot() # Take a picture and return the image.
objects = img.find_features(face_cascade, threshold=0.75, scale=1.35)
if objects:
max_blob = find_max(objects)
pan_error = max_blob.cx()-img.width()/2
tilt_error = max_blob.cy()-img.height()/2
print("pan_error: ", pan_error)
img.draw_rectangle(max_blob.rect()) # rect
pan_output=pan_pid.get_pid(pan_error,1)/2
tilt_output=tilt_pid.get_pid(tilt_error,1)
print("pan_output",pan_output)
pan_servo.angle(pan_servo.angle()+pan_output)
tilt_servo.angle(tilt_servo.angle()-tilt_output)
![0_1561518235957_}`8~7DP7X6_]2FW`IA%J3{M.png](https://fcdn.singtown.com/4654577d-b6fc-4356-8548-328ea224ffa7.png)