const float sea_press = 1013.25;
void setup() {
}
void loop() {
}
float getAltitude(float pressure, float temp) {
// return ((pow((sea_press / pressure), 1/5.257) - 1.0) * (temp + 273.15)) / 0.0065;
int p = (sea_press / pressure);
//p = 7;
return ((pow(p, 1/5.257) - 1.0) * (temp + 273.15)) / 0.0065;
}
which gives:
sketch_may05b.cpp.o: In function `loop':
sketch_may05b.cpp:(.text+0x38): undefined reference to `pow'
sketch_may05b.cpp.o: In function `getAltitude(float, float)':
sketch_may05b.cpp:(.text+0x82): undefined reference to `pow'
collect2.exe: error: ld returned 1 exit status
Error compiling.
Uncomenting the p=7 line then it works fine, and it works fine changing the board type to be an Uno.
Any ideas how to get this to compile?