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);
}
}
}