我正在研究需要abs()函数的arduino库:
#include <math.h> normTransFreq1 = abs(1.0);
错误:此范围内未声明'abs'
由于 math.h 已经包含在cpp I 'm entirely unsure how to fix this problem. A new install of arduino 1.5.2 didn' t帮助中 .
math.h
刚刚找到解决方案:
库不需要包含math.h . 相反,应该通过在头文件中添加以下内容来包含Arduino.h:
#if ARDUINO >= 100 #include "Arduino.h" #else #include "WProgram.h" #endif
1 回答
刚刚找到解决方案:
库不需要包含math.h . 相反,应该通过在头文件中添加以下内容来包含Arduino.h: