error: 'Target' was not declared in this scope

error: 'Target' was not declared in this scopeBad error line: -2

When I try and compile my code, This the error message a get.

It doesn't highlight anything. But is says theirs an error with a negative line number, if you insert new lines at the top of the code you just get this error message "error: 'Target' was not declared in this scope"

I think the Error message is saying that my variable 'Target' need to be declared somewhere else in the program but it is only used in 1 function (see below). If I take out the second line ('int Target;') you get the same error message. I also copied the function into its own sketch and I get the same error message.

Can anybody Help me ???

int MOVE (Target) {
int Target;
if (Target < analogRead(Gear_Position)){
digitalWrite(UP_DOWN, LOW);
}
else {
digitalWrite(UP_DOWN, LOW);
}
while (Target != analogRead(Gear_Position)){
analogWrite(Motor_Control, SPEED);
CHANGING_LED();
}

analogWrite(Motor_Control, 0);

}

int MOVE(int Target) {
 if (Target < analogRead(Gear_Position)){
   digitalWrite(UP_DOWN, LOW);
 }
 else {
   digitalWrite(UP_DOWN, LOW);
 }
 while (Target != analogRead(Gear_Position)){
   analogWrite(Motor_Control, SPEED);
   CHANGING_LED(); 
 }
  
 analogWrite(Motor_Control, 0); 

}
int MOVE (Target) {

You haven't given "Target" a type.

Best if you post the whole sketch.

if (Target < analogRead(Gear_Position)){
   digitalWrite(UP_DOWN, LOW);
 }
 else {
   digitalWrite(UP_DOWN, LOW);
 }

why not just simply:digitalWrite(UP_DOWN, LOW);?

Thanks, putting int' in front of the 'Target' Parameter work.

I'd forgotten to change the LOW to an HIGH after I copy the line, thanks for saving me some debugging time.

if (Target < analogRead(Gear_Position)){
digitalWrite(UP_DOWN, HIGH);
}
else {
digitalWrite(UP_DOWN, LOW);
}

Peter