I can't figure out why I'm getting this error message - what am I missing? I get the error for the first line of the limit_int_fcn, pointing to the semicolon in the first argument, "int v;" This was part of a larger program and I've just retained the minimum to see the error.
I'm an experienced programmer but this one has me baffled. I tried compiling under both Arduino 1.8.5 and 1.8.6; same results. (p.s. I know I can do this with the constrain() function but I still want to know why I get this error)
const int MY_LED = 8;
void setup() {
Serial.begin(9600);
delay(1000);
pinMode(MY_LED, OUTPUT);
}
int limit_int_fcn(int v; int minv; int maxv) {
if (v > maxv) v = maxv;
else if (v < minv) v = minv;
return v;
}
void loop () {
digitalWrite(MY_LED, true);
delay(500);
digitalWrite(MY_LED, false);
delay(500);
}