camera goes to corner when finds light

Using easy-c, I have a functioning camera code inside the operator control function. It looks left, right, up and down until it finds the light. When it does find it, the set servo tracking button usually will follow the light succesfully. About 30% of the time, however, once the camera finds the light, it just goes into the upper left corner, and I have no idea why. Does anyone know how to correct this?

If you are using the default tracking code, when it goes to the upper left, that means it has lost lock on the target and has restarted searching.

Are you using a fresh battery?

I am using a fresh battery, and I am not using the default camera code.

Does it work with the default camera code, then?

Your code is controlling the servos, so if you aren’t using the default code, you’ll have to share at least some of your code with us.

Is it locked on to the target though? Returning target data? If so, it may be a matter of the settings for the target pixel.

It sounds like youre camera looks away from the light.
In the tracking.h module there are some bits to change:
Look for:

// If your camera suddenly moves away from the target once
// it finds it, you’ll need to change the sign on one or
// both of these values.

Try experimenting with these.