Semicolon Token problem

Hello, I’m a bit new to Arduino, and I’ve come across an error in my fire-seeking robot code while verifying. It comes across as an “expected ‘;’ before ‘)’ token” error, but I did plenty of research and I can’t seem to find where I’ve gone wrong.

#define enA 8
#define in1 4
#define in2 5
#define enB 9
#define in3 6
#define in4 7
#define flame_Sensor_pin A0       // initializing A0 as sensor pin
#define Led_pin 12                // initializing pin 12 as led pin
int Value = 0;  // initializing a variable to store sensor value
int nValue = 0;
int turn_x = 15;

void setup() {
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  pinMode(Led_pin, OUTPUT);
  Serial.begin(9600);
}
void loop() {
//forward movement
 // Set Motor A forward 
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
 // Set Motor B forward
digitalWrite(in3, LOW);
digitalWrite(in4, HIGH);

//tells motors to stop after 1 second
delay(1000); 
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
digitalWrite(in3, LOW);
digitalWrite(in4, LOW);

//start protective scan
Value = analogRead(flame_Sensor_pin);
if(Value > 500){
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(1000);
digitalWrite(Led_pin, HIGH);
exit(0);
}
//begin search scan


for ( turn_x = 15, turn_x >= 0, turn_x --)
{
  if(Value < 500); {
nValue =analogRead(flame_Sensor_pin);
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
digitalWrite(in3, HIGH);
digitalWrite(in4, LOW);
delay(25);
Value = analogRead(flame_Sensor_pin);
if (Value > nValue)
{
nValue = Value
turn_x = 0
}
else if (Value < nValue)
{}//continue
}
}
}

Thanks in advance for any help at all, googling only gets you so far. If this breaks any rules I didn’t see, I will take it down, just please let me know. I’m just starting this forum stuff.

You should use the auto indent function of the IDE, also available with CTRL T
This helps to see the blocks.

When you have compilation errors, the compiler provides the lines numbers in which it found the errors. In your case, there is an error here:
    if (Value < 500); {another one here (visible thanks to autoindent)

        nValue = Value

1) Not the cause of the problem but learn to indent properly. Use tools -> autoformat in the IDE. Do you see something odd at line 66 and 67? 2) Which line was highlighted in the code? Look closely at your for-loop. A for-loop has three 'arguments', yours only has one. Change the commas to semi-colons. 3) Look closely at line 56; not an error but a bug :)

lesept, sterre, Thank you both, I got it to verify now and I can begin the testing of my robot.

Hi, Welcome to the forum.

I have added to you a Karma point, for your use of the code tags in your first post.

Thanks.. Tom.... :)