Arduino- 编译引用 IRremote 出现 error: ‘TKD2′ was not declared in this scope
来源:互联网 发布:股市模拟交易软件 编辑:程序博客网 时间:2024/05/16 19:48
制作四驱车机器人时想用手边的红外遥控器做一个简单的控制,编译出现“error: ‘TKD2′ was not declared in this scope”的错误。
1.原因分析
使用红外遥控器需要包含红外遥控头文件
#include <IRremote.h> //调用IRremote.h库编译出错提示为:
提示出错的原因是:IRremoteTools冲突。百度一下原因为Arduino 1.5.5 r2以后加入的RobotIRremote 库与 IRremote库有冲突。在IRremoteTools.cpp中有如下代码:
#include "IRremote.h"#include "IRremoteTools.h"#include <Arduino.h>int RECV_PIN = TKD2; // the pin the IR receiver is connected toIRrecv irrecv(RECV_PIN); // an instance of the IR receiver objectdecode_results results; // container for received IR codes上述代码中将TKD2赋予 RECV_PIN,而我们写的代码里并没有定义TKD2,因此编译程序执行到这时报错。
2. 删除或剪切走冲突文件
解决方法是在Arduino安装目录…Arduino\libraries\RobotIRremote\src 文件夹下将如下两个文件删除或剪切到非编译搜索路径下的某个位置即可
本机安装的路径为:C:\ProgramFiles (x86)\Arduino\libraries\RobotIRremote\src
0 0
- Arduino- 编译引用 IRremote 出现 error: ‘TKD2′ was not declared in this scope
- Arduino ide 1.6.9 遇到的问题 error: 'TKD2' was not declared in this scope
- opencv 2.3交叉编译时出现dist.h:63:68: error: 'fabsl' was not declared in this scope
- error: '_localtime_not_threadsafe_' was not declared in this scope
- error: ‘exit’ was not declared in this scope
- error: `cout' was not declared in this scope
- error: 'UINT64_C' was not declared in this scope
- error: 'memcpy' was not declared in this scope
- error: 'memcpy' was not declared in this scope的解决
- error: ‘BYTE’ was not declared in this scope
- error: ‘closesocket’ was not declared in this scope
- error:inet_addr() was not declared in this scope
- error: ‘exit’ was not declared in this scope 的解决方法
- 关于error: ‘htons’ was not declared in this scope
- error: ‘memcpy’ was not declared in this scope 解决
- error: ‘alarm’ was not declared in this scope 解决
- error: ‘ostream_iterator’ was not declared in this scope
- error: 'glGenFramebuffersOES' was not declared in this scope
- iOS 【应用程序app运行原理-UIApplication-AppDelegate.m-UIApplicationMain】
- c++11,std::find的并行化模板化
- 前端工程化和Reactjs的模式
- unity3D 实现NGUI物体朝鼠标点击位置移动
- Java8の字符串操作
- Arduino- 编译引用 IRremote 出现 error: ‘TKD2′ was not declared in this scope
- 使用此函数添加任意数量的load事件处理函数
- 【已解决】Xen下虚拟机执行Shutdown失败,开机自动重启虚拟机,并出现页故障问题
- SlidingMenu-jar包
- 第二十四节 OAD空中升级
- bzoj3208 花神的秒题计划 记忆化搜索&暴力
- AndroidStudio快捷键汇总
- 交换两个数的值(不使用第三个变量)
- 漫谈数据中心CLOS网络架构