IR remote test error

Hi all!
arduinofreaklol here!

I coded 2 tests for an IR remote and both of them had errors.
Here’s the code for the 1st test:

#include <IRremote.h>

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn();
}

void loop() {
  if(irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume();
  }
}

Here’s it’s error:

C:\Program Files\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
                ^
Multiple libraries were found for "IRremote.h"
 Used: C:\Program Files\Arduino\libraries\RobotIRremote
 Not used: C:\Users\kaiser academy\Documents\Arduino\libraries\Arduino-IRremote-master
Error compiling.

:\

Here’s the code for the 2nd test:

#include <IRremote.h>

int RECV_PIN = 3;
int led1 = 2;
int led2 = 4;
int led3 = 7;
int itsONled[] = {0, 0, 0, 0};

#define code1 63495
#define code2 30855
#define code3 22695

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup() {
  Serial.begin(9600);
  irrecv.enableIRIn();
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
}

void loop() {
  if(irrecv.decode(&results)) {
    unsigned int value = results.value;
    switch(value) {
      case code1:
      if(itsONled[1] == 1) {
        digitalWrite(led1, LOW);
        itsONled[1] = 0;
      } else {
        digitalWrite(led1, HIGH);
        itsONled[1] = 1;
      }
      break;
      case code2:
      if(itsONled[2] == 1) {
        digitalWrite(led2, LOW);
        itsONled[2] = 0;
      } else {
        digitalWrite(led2, HIGH);
        itsONled[2] = 1;
      }
      break;
      case code3:
      if(itsONled[3] == 1) {
        digitalWrite(led3, LOW);
        itsONled[3] = 0;
      } else {
        digitalWrite(led3, HIGH);
        itsONled[3] = 1;
      }
      break;
    }
    Serial.println(value);
    irrecv.resume();
  }
}

Here’s the error:

C:\Program Files\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
                ^
Multiple libraries were found for "IRremote.h"
 Used: C:\Program Files\Arduino\libraries\RobotIRremote
 Not used: C:\Users\kaiser academy\Documents\Arduino\libraries\Arduino-IRremote-master
Error compiling.

:confused:

What does this error mean and how do i fix it?
Am i using the wrong library?

arduinofreaklol :I

What does this error mean

It means that the idiots at Arduino foisted that stupid robot library off on everyone, regardless of whether they have a robot, or not.

and how do i fix it?

If you do not have an Arduino robot, and, apparently, almost no one does, delete the stupid file.

So the library doesn't work anymore?

There are duplicates in the robot library that sometimes confuse the compiler. If you're not using the robot library, you're safe deleting it (or stashing it in an out of the way folder).

--Michael

arduinofreaklol: So the library doesn't work anymore?

Which library? The one for the Arduino Robot or the general IR library? They both work, on the right hardware. Why the idiots at Arduino needed to create another IR library, but were too lazy to change the name, is a mystery.