Coding a line following robot to turn on and off with signal from an IR remote

Hey, I've been working on this code for a customer of mine but it doesn't seem to work with his setup. The code verifies and the logic is correct. I've also looked at some stock code and modified it to fit my purpose but it still doesn't seem to work. Can somebody help, please it's very urgent!

newline.ino (2.04 KB)

but it doesn't seem to work with his setup.

What does it do ?

What do you see when you print results.value ?

I assume that you know that lineFollow(2); does nothing.

void lineFollow(int gotime)
{
  while(gotime == 1)
  {
    if (sen3 > (sen2+threshhold))
    {
      driveMotorLeft(150-30);
      driveMotorRight(150+30);
    }

    if (sen1 > (sen2+threshhold))
    {
      driveMotorLeft(150+30);
      driveMotorRight(150-30);
    }
    else
    {
      driveMotorLeft(150);
      driveMotorRight(150);
    }
  }
}

Once that function gets called with a value of 1, it will never end. Why are you using an infinite loop in that function?