使用Arduino Due调用FFT库函数时编译器报错

在使用Arduino Due和Arduino 1.8.9 IDE进行FFT运算时遇到编译错误,主要包括'PI重定义'和'库函数无法调用'。为解决这些问题,对wiring_constants.h文件中涉及'PI'定义的部分进行了注释,并将libarm_cortexM3l_math.a文件从一个目录复制到另一个目录。同时,修改了platform.txt文档的编译选项。完成这些步骤后,成功编译并能调用FFT函数库。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近在用Arduino Due开发板调用库函数进行FFT运算,我选择的IDE为Arduino 1.8.9,安装的软件包为Arduino SAM boards(32-bits ARM Cortex-M3)by Arduino 版本1.6.12,但编译器始终不通过,错误如下:

Arduino:1.8.9 (Windows 10), 开发板:"Arduino Due (Programming Port)"

构建选项已变更,全部重新构建
In file included from F:\Arduino\EIT\EIT.ino:3:0:

C:\Users\Lenovo\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\system/CMSIS/CMSIS/Include/arm_math.h:283:0: warning: "PI" redefined [enabled by default]

 #define PI     3.14159265358979f

 ^

In file included from C:\Users\Lenovo\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/Arduino.h:44:0,

                 from sketch\EIT.ino.cpp:1:

C:\Users\Lenovo\AppData\Local\Arduino15\packages\arduino\hardware\sam\1.6.12\cores\arduino/wiring_constants.h:36:0: note: this is the location of the previous definition

 #define PI 3.1415926535897932384626433832
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值