Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'TKD2' was not declared in this scope #98

Closed
farzher opened this issue Nov 15, 2014 · 25 comments
Closed

'TKD2' was not declared in this scope #98

farzher opened this issue Nov 15, 2014 · 25 comments

Comments

@farzher
Copy link

@farzher farzher commented Nov 15, 2014

arduinounoerror

@lichtteil

This comment has been minimized.

Copy link

@lichtteil lichtteil commented Nov 16, 2014

I had the same issue! There is a conflict with the new(?) RobotIRremote-Library of Arduino IDE 1.0.6.
My solution was to take RobotIRremote out of the Arduino-libraries folder and everything worked again.

@joshuajnoble

This comment has been minimized.

Copy link
Collaborator

@joshuajnoble joshuajnoble commented Nov 16, 2014

Yes, this is a known issue and we've submitted a patch to the Arduino project but haven't heard back yet on it. I'm going to close this one because its already covered by #91

@farzher

This comment has been minimized.

Copy link
Author

@farzher farzher commented Nov 16, 2014

I see, cool.

Since you guys probably know about IR receivers, I want to ask a question real quick:
If I hook up my receiver to analog pin 0, then do analogRead(0), what type of numbers should I see coming back? should the numbers change around when I press buttons on my remote?
Mine just kept returning like 945 and didn't respond to any remote, I assume that means it's not working?

(I'm trying to debug if my receiver even works.)

@lichtteil

This comment has been minimized.

Copy link

@lichtteil lichtteil commented Nov 17, 2014

You can't just measure it cause there is a digital signal coming from the receiver. Have a look at the datasheet of your IR receiver. For example here at page 3 and 4: http://www.vishay.com/docs/82459/tsop48.pdf

Be sure to hook it up correctly according to your specific IR receiver.

@tytower

This comment has been minimized.

Copy link

@tytower tytower commented Dec 20, 2014

This issue is caused by someone changing the stock library to suit the RS Components robot board on which the pins are called TK whatever so TKD2 is a pin on that robot board . Now this interferes with the examples and the library must be deleted and replaced for it to compile properly.

Arduino 1.5.8 wrongly includes this adulterated library as RobotIRRemote. It needs to be replaced with the original correct IRRemote library in the next releases

@sandhysanjaya

This comment has been minimized.

Copy link

@sandhysanjaya sandhysanjaya commented Jan 19, 2015

Hai, Just rename your Folder library... Like this From "IR" to "IRremote"
thats default i think

@joshuajnoble

This comment has been minimized.

Copy link
Collaborator

@joshuajnoble joshuajnoble commented Jan 22, 2015

Yes, it's out of our hands unless we rename the whole library, which I'd prefer not to do.

@Bharadwaj1

This comment has been minimized.

Copy link

@Bharadwaj1 Bharadwaj1 commented Feb 10, 2017

hi, I've problem with my arduino software regarding TKD2 error . as lichtteil said that I've removed my RobotIRremote out of the Arduino-libraries folder but its not working and still displays an error. I request anyone, please resolve my problem.
issue

@Bharadwaj1

This comment has been minimized.

Copy link

@Bharadwaj1 Bharadwaj1 commented Feb 10, 2017

issue2

@AnalysIR

This comment has been minimized.

Copy link
Contributor

@AnalysIR AnalysIR commented Feb 10, 2017

@Bharadwaj1

did you try restarting the IDE?

@Bharadwaj1

This comment has been minimized.

Copy link

@Bharadwaj1 Bharadwaj1 commented Feb 10, 2017

Yes I've did it sir

@Bharadwaj1

This comment has been minimized.

Copy link

@Bharadwaj1 Bharadwaj1 commented Feb 10, 2017

I've downloaded the arduino IR remote master from this website..but my error when RobotIRremote out of the Arduino-libraries folder it shows the error.

C:\Program Files\Arduino\examples\Arduino-IRremote-master\examples\IRrecvDemo\IRrecvDemo.ino:9:22: fatal error: IRremote.h: No such file or directory

@z3t0

This comment has been minimized.

Copy link
Owner

@z3t0 z3t0 commented Feb 10, 2017

Please copy it to arduino/libraries not examples in your documents directory

@z3t0 z3t0 reopened this Feb 10, 2017
@z3t0 z3t0 closed this Feb 10, 2017
@ramnath555

This comment has been minimized.

Copy link

@ramnath555 ramnath555 commented Mar 29, 2017

A simple solution... open IRremoteTools.cpp which is in "C:\Program Files\Arduino\libraries\RobotIRremote\src" and replace TKD2 with any number. I put 1. now try arduino code.. it works like a charm!!!!

if you use "results" variable in your code there you may get a "(.text+0x0): multiple definition of `results'" error. change your variable to "results1"... ;)

@z3t0

This comment has been minimized.

Copy link
Owner

@z3t0 z3t0 commented Mar 29, 2017

@ramnath555 A better solution is to remove RobotIRremote altogether

@ramnath555

This comment has been minimized.

Copy link

@ramnath555 ramnath555 commented Mar 29, 2017

Removing "RobotIRremote" will give "'IRremote.h' not found" - :) . It you use older IRLib.h then most of the remotes will give 0 value for all keys

@z3t0

This comment has been minimized.

Copy link
Owner

@z3t0 z3t0 commented Mar 30, 2017

You should not be using robotics irremote along with this library. They conflict

@marcmerlin

This comment has been minimized.

Copy link
Contributor

@marcmerlin marcmerlin commented Apr 1, 2017

@z3t0 : So, I've read the multiple issues on this over the last 2 years.
It's easy enough for everyone to delete arduino-xxx/libraries/RobotIRremote/ every time they install or upgrade the arduino IDE, but really this is not a fix.
When I give my code around, everyone is going to hit this problem.
I realize it's not your fault but it seems that in the last 2 years, the arduino folks have not fixed anything to make your library work out of the box again.
Now the part I don't even understand is that in one of my programs, it does
Used: /var/local/arduino-1.8.2/libraries/RobotIRremote
Not used: /home/merlin/Arduino/libraries/Arduino-IRremote
and in the other one, it goes the other way around (randomly?) and works.

Of course, there seems to be no way to force the IDE to use my local libraries over its own, and it still ignores include "foo." vs include <foo.h> it seems when it could have used it as a hint/workaround.

So, is there really no long term fix to this? Everyone must delete libraries/RobotIRremote forever on every copy of the arduino IDE they ever install?
If so, would it be easier to have the library just rename its IRremote.h to RealIRremote.h or somesuch to work around the issue?

@z3t0

This comment has been minimized.

Copy link
Owner

@z3t0 z3t0 commented Apr 1, 2017

@marcmerlin You have made a really good point that honestly I have never considered! I very rarely update Arduino and I don't even recall if I needed to delete RobotIRremote the last time. But considering what you have said I will certainly find a way to fix this. If I recall, the issue was that RobotIRremote was initially a fork of this library (or something like that) and so there are symbols that are duplicates in both instances. I will go ahead and prioritize this as a new issue

@dmccreary

This comment has been minimized.

Copy link

@dmccreary dmccreary commented Apr 7, 2017

It took me about an hour, but I finally figured out a solution. 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!

I did try several other suggestions mentioned above. However, each of them failed.

For other instructors we will include this fix in the CoderDojo robot book.

@prnus

This comment has been minimized.

Copy link

@prnus prnus commented Jun 6, 2017

[SOLVED]
It happened the same to me but now I solved the problem. When I had to import the library, I choose the RobotIRremote one from the list and it didn't work.
So I downloaded this library (https://github.com/z3t0/Arduino-IRremote) called IRremote and then imported the downloaded ZIP file. When you have to import you have to click on sketch -> import library -> import library from ZIP file and select the downloaded ZIP file. When you did this you are not finish yet. After this the imported library IRremote(-master, if you didn't renamed the file) will appear on your list of libraries to import (it will be shown below, you have to scroll down because it's not seen). So click again on sketch -> import library -> IRremote(-master) and now it will work.

P.S: I renamed it into IRremote (without "-master")

@khaldon

This comment has been minimized.

Copy link

@khaldon khaldon commented Oct 31, 2017

I have the same problem and until now I can't solve it my project is stopped because the IR

@AnalysIR

This comment has been minimized.

Copy link
Contributor

@AnalysIR AnalysIR commented Oct 31, 2017

  1. It seems this issue was closed & you should open a new one & refer back to this one
  2. If you have the same problem the solution is likely above.
  3. If not, a search is bound to show a solution for this problem
  4. More importantly, you have not provided any meaningful explanation of your problem (or what steps you have taken to try to resolve your problem), to allow other to assist.
@HaGaDIY

This comment has been minimized.

Copy link

@HaGaDIY HaGaDIY commented Dec 31, 2017

I have encountered the same problem. corrected and successful
Step 1: Download and install. Sketch ---> Include Library ---> Add Library https://github.com/shirriff/Arduino-IRremote/
Step 2: Remove the RobotIRremote library in the Arduino.
Step 3: Compile and succeed

@tytower

This comment has been minimized.

Copy link

@tytower tytower commented Jan 25, 2018

Seems to be fixed in the latest IDE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.