Bonding an Ir camera to two dc motors.

Hello everyone. I'm building a robot called robotisto. His goal is to follow a person using an ir SEN0158 camera. I found a code for the camera but don't know how to get it to work with the programm i made with my two dc motors.
Can someone help me out? Here is my code.

The camera is able to detect up to four IR sources (i would like to use only two).
I want the robot to keep a balance between the two IR spots and if one measurement is lower than the other one of the motors to spin faster than the other one to turn the robot to get the balance between the measurements back.

It would be really nice to help me out.
Thank you.
your fellow robotisto.

IR_test.ino (2.99 KB)

I want the robot to keep a balance between the two IR spots and if one measurement is lower than the other one of the motors to spin faster than the other one to turn the robot to get the balance between the measurements back.

How much faster? Which one?

What have you tried? What were the results?

Well frankly, the code isn't even running. I'm just having issues on getting the code for the ir camera to interact with the motors. I never used arduino in such a way and i barely never coded.
I'm sorry though.

New programmer or not, there is not excuse for comments that do not match the code:

  Wire.requestFrom(slaveAddress, 16);        // Request the 2 byte heading (MSB comes first)
    Serial.print( int(Ix[i]) );

Casting an int to an int is dumb.

  if (Ix[1] = Ix[2]) {

There is a world of difference between the = operator and the == operator. Learn the difference. Use the correct operator.

The first two quotes are from the official code for the IR camera i'm using.
I looked up the == and got the difference. Thank you anyway.
Sorry for the mistakes.

So, your problems are solved? If not, post the correct code, explain what it actually does, and how that differs from what you want.