'TKD2' was not declared in this scope

I tried to compile an example code of a simple IR receiver. I get following error:

C:\Program Files (x86)\Arduino\libraries\RobotIRremote\src\IRremoteTools.cpp:5:16: error: 'TKD2' was not declared in this scope

int RECV_PIN = TKD2; // the pin the IR receiver is connected to

^
exit status 1
Error compiling.

I think this is an issue with the Arduino libraries. How can I solve this issue?

Just in case, here is the code I try to compile:


#include <IRremote.h>
int RECV_PIN = 6;
long LED_ON = 0x00FF02FD;
long LED_OFF = 0x00FF22DD;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
// initialize the digital pin as an output.
pinMode(RECV_PIN, INPUT);
pinMode(3, OUTPUT);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
int i=0;
if (irrecv.decode(&results))
{
irrecv.resume(); // Receive the next value
if (results.value == LED_ON )
{
digitalWrite(3,LOW);
}
if (results.value == LED_OFF )
{
digitalWrite(3,HIGH);
}
}
}

download Ken Shirrif's IRRemote libraries.

Thanks MalharD, I will check that out. But as I am new to Arduino, I am interested in the root cause of this problem. Is the IR library provided with Aruidno IDE faulty? Isn't this something that should be fixed?

It's usually caused by a conflict between "IRremote" and "RobotIRremote"

If you already have "IRremote" installed, you need to delete "RobotIRremote".

Those two libraries cannot co-exist.
Edit: You won't lose any functionality by deleting "RobotIRremote" - "IRremote" replaces it.

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!