Newbie here. I need an advice....

Hello everyone! I am trying to copy and modify a project’s code: a camera that can move based on the location of a face. In other words, a camera that can track a face. I’ ve done some alterations on this code but it is not enough for what I ve imagined. I want this camera’ s horizontal servo to move from 0 to 180 and search for a face until it finds one. Currently, it can track the face. I am trying to implement the example code (sweep) of arduino to my code but I am not succesfull yet. You can find my code in the attachment. Please help me…

PS: I am not a native English speaker.

orjinalface.ino (3.42 KB)

Sweeep.ino (1016 Bytes)

Your originalface.ino file does NOT track a face. It simply moves some servos based on serial input, presumably from some software that is actually doing the tracking.

Your Sweeep.ino file simply sweeps one servo back and forth.

You have not posted your attempt to combine the two, and it is not clear what your problem with the code you didn't post is.

It is also NOT AT ALL clear why you think you can move the camera independent of input from the application that is tracking the face.