问题
i am a beginner in arduino and that's my first IR project and yet i have a problem with compiling ...
Arduino error : TKD2 was not declared in this scope
About the code i used is the example IRrecvDemo .
回答1:
I've just bought an arduino beginner pack (sunfounder) and I had the same issue. What I did is:
- Delete the library IrRemote: (C:\Program Files\Arduino\libraries\RobotIRremote)
- Download a good one. Can be found at https://codeload.github.com/z3t0/Arduino-IRremote/zip/master
- Install it using the Arduino program's menú: Program -> Include Library -> Add .ZIP library
回答2:
Most like you have already googled the answer or given up. Well, hoping for the first option, I have not seen into this in detail but I found two workarounds.
Seems to me that the Robot IR Remote library has an issue there.
You can either remove the files IRremoteTools.cpp and IRremoteTools.h from your directory C:/programs/arduino/libraries/Robot_IR_Remote/src/ (or the approriate path for your OS) or go to
https://github.com/z3t0/Arduino-IRremote
and get yourself an IR remote library that is working as it is.
Seems to me the numeric values to a given IR signal vary between both libraries. But then again I did not go into any details there. Perhaps someone else can elaborate on that point.
Good luck.
回答3:
just delete RobotIRremote file in the libraries and download the IRremote-master againly copy paste into the libraries file
回答4:
On the Mac I used the Terminal application and did a "cd /Applications/Arduino.app" followed by an "open .". That opened up the Finder inside the Arduino application. I then navigated to the contents/Java/libraries and removed the RobotIRRemote folder. I then went to main Arduino/Sketch/Include Library.../Manage Libraries and did a search for the IRRemote library. After I imported that the libraries complied without any problem!
来源:https://stackoverflow.com/questions/33008961/arduino-error-tkd2-was-not-declared-in-this-scope