I inserted a round function into my code and it complained during compilation. It turns out that the wiring.h has a #define round, that conflicts with the c round function.
The following code will not compile until the line with the round function is commented out.
The wiring.h file has the command on line 80
The following code will not compile until the line with the round function is commented out.
Code:
// comment out the next line and all works
double yd = round(sqrt(PI));
float yf = roundf(sqrt(PI));
long int yi =roundl(sqrt(PI));
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
The wiring.h file has the command on line 80
Code:
#define round(x) ({ \
typeof(x) _x = (x); \
(_x>=0) ? (long)(_x+0.5) : (long)(_x-0.5); \
})