IR ino upload error


i assembled elegoo smart robot car kit v1.0 came uno r3 board , works fine auto go , other ino files move car uploading using arduino 1.8.0 ide. there error uploading .ino file infrared_blink.ino , error message  shown below. wondering if can fix 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 output
serial.begin(9600);       // debug output @ 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 next value
    delay(150);
     if(red==l)
  { 
     statechange();
   }
  }
     }

___________________________
error message
___________________________
 
c:\program files (x86)\arduino\libraries\robotirremote\src\irremotetools.cpp:5:16: error: 'tkd2' not declared in scope

 int recv_pin = tkd2; // pin ir receiver connected to

                ^

exit status 1
error compiling board arduino/genuino uno.

please use code tags (</> button on toolbar) when post code or warning/error messages. reason forum software can interpret parts of code markup, leading confusion, wasted time, , reduced chance problem. make easier read code , copy ide or editor. using code tags , other important information explained in how use forum post. please read it.

please tools > auto format on code before posting it. make easier spot bugs , make easier read.

the problem you're using wrong irremote.h file. robotirremote library written arduino robot uses atmega32u4 code incompatible atmega328p on uno. need install correct please this:
  • sketch > include library > manage libraries...
  • type "irremote" "filter search..." box.
  • click on "irremote shirriff" item.
  • click "install"
  • wait installation complete.
  • click "close"
  • try uploading sketch again.


Arduino Forum > Using Arduino > Installation & Troubleshooting > IR ino upload error


arduino

Comments

Popular posts from this blog

DHT11 Time out error using v0.4.1library

Sketch upload fails with Java error (___REMOVE___/bin/avrdude)!

Arduino Uno + KTY81/210 temperature sensor