HI, I am new to arduino I have an uno 3 and adafruit motor controller which i am using to control a robot using IR ,This works fine but at present I am only at the stage where i can modifying other people code ,I have books on order . I have also predefined TimeDelay as a global integer.
My problem :-
void goRight()
{
TimeDelay = TimeDelay - 1;
myMotor->setSpeed(150);
myMotor->run(FORWARD);
myOtherMotor ->setSpeed(150);
myOtherMotor->run(BACKWARD);
Serial.println("going Right....");
Serial.println(TimeDelay);
if(TimeDelay == 0);
{
goStop();
TimeDelay = 30;
}
else
{goRight();}
}
I am trying to make the robot turn 45 then stop ...
the error code is :-
motor_with_remote.ino: In function 'void goRight()':
motor_with_remote:61: error: 'else' without a previous 'if'
Can some point me in the right direction please