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);
}