IR ino upload error

I just assembled Elegoo smart robot car kit v1.0 that came with UNO R3 board and it works fine with auto go and other ino files to move the car uploading using Arduino 1.8.0 IDE. However there is error uploading .ino file for infrared_blink.ino and the error message are shown below. I was wondering if someone can help to fix this error.

//www.elegoo.com
//2016.09.12

#include <IRremote.h>//Infrared Library
int receiverpin = 12;//Infrared signal receiving pin
int LED=13; //define LED pin
volatile int state = LOW; //define default input mode
unsigned long RED;
#define L 16738455
IRrecv irrecv(receiverpin);//initialization
decode_results results;//Define structure type
void setup() {
pinMode(LED, OUTPUT); //initialize LED as an output
Serial.begin(9600); // debug output at 9600 baud
irrecv.enableIRIn();// Start receiving
}
void stateChange()
{
state = !state;
digitalWrite(LED, state);
}
void loop() {
if (irrecv.decode(&results))
{
RED=results.value;
Serial.println(RED);
irrecv.resume(); // Receive the next value
delay(150);
if(RED==L)
{
stateChange();
}
}
}


Error Message


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 for board Arduino/Genuino Uno.

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. Using code tags and other important information is explained in the How to use this forum post. Please read it.

Please always do a Tools > Auto Format on your code before posting it. This will make it easier for you to spot bugs and make it easier for us to read.

The problem is you're using the wrong IRremote.h file. The RobotIRremote library is written for the Arduino Robot which uses an ATmega32U4 so the code is incompatible with the ATmega328P on your Uno. You need to install the correct Please do this:

  • Sketch > Include Library > Manage Libraries...
  • Type "IRremote" the "Filter your search..." box.
  • Click on the "IRremote by shirriff" item.
  • Click "Install"
  • Wait for installation to complete.
  • Click "Close"
  • Try uploading your sketch again.

Thanks for your suggestions. I am new to this forum and have no experience on code writing. I used the code that came with the car kit. I followed your steps and the sketch was able to upload successfully this time. However the robot car seems not responsive to none of the buttons of IR remote control and the light on the IR receiving sensor light does not blink that was blinking earlier. Any suggestion to fix this will be very much appreciated.