error compiling for arduino uno board

i wanted to make ir controlled home automation project as mentioned in this linkhttps://circuitdigest.com/microcontroller-projects/ir-remote-controlled-home-appliances
but the problem is when i copied the code and pasted it in arduino IDE sketch there it showed

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

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.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

any possible help

another thing to mention is that i tried another code of the same website and it showed the same error

Maybe try here..

https://github.com/z3t0/Arduino-IRremote/issues/98

https://github.com/z3t0/Arduino-IRremote/issues/91

Southpark:
Maybe try here..

GitHub · Where software is built

thanks for suggestion
i downloaded the library renamed it but the search results were as

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

java.io.FileNotFoundException: C:\Users\VAIO\irremote (The system cannot find the file specified)
	at java.util.zip.ZipFile.open(Native Method)
	at java.util.zip.ZipFile.<init>(ZipFile.java:219)
	at java.util.zip.ZipFile.<init>(ZipFile.java:149)
	at java.util.zip.ZipFile.<init>(ZipFile.java:163)
	at processing.app.tools.ZipDeflater.<init>(ZipDeflater.java:26)
	at processing.app.Base.handleAddLibrary(Base.java:2242)
	at processing.app.Base$6.actionPerformed(Base.java:1067)
	at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
	at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
	at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
	at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
	at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
	at java.awt.Component.processMouseEvent(Component.java:6533)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
	at java.awt.Component.processEvent(Component.java:6298)
	at java.awt.Container.processEvent(Container.java:2236)
	at java.awt.Component.dispatchEventImpl(Component.java:4889)
	at java.awt.Container.dispatchEventImpl(Container.java:2294)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
	at java.awt.Container.dispatchEventImpl(Container.java:2280)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4711)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
	at java.awt.EventQueue.access$500(EventQueue.java:97)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.awt.EventQueue$3.run(EventQueue.java:703)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
	at java.awt.EventQueue$4.run(EventQueue.java:731)
	at java.awt.EventQueue$4.run(EventQueue.java:729)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
C:\Users\VAIO\irremote (The system cannot find the file specified)

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Do this:

  • Delete C:\Users\VAIO\irremote. Please be very careful when deleting files on your computer. When in doubt back up!
  • Sketch > Include Library > Manage Libraries...
  • Wait for download to finish.
  • In the "Filter your search..." box, type "irremote"
  • Click on "IRremote by shirriff"
  • Click "Install"
  • Wait for installation to complete.
  • Click "Close"

i deleted the file and did exactly as mentiioned by pert but again it shows the same error that it is unable to compile with arduino uno.

the same problem is happening with another code that i have now mentioned i got this code from;

  http://howtomechatronics.com/projects/diy-led-heart-photo-frame-arduino-project/
/*  LED Heart Photo Frame - Arduino Project
 *  Program made by Dejan Nedelkovski,
 *  www.HowToMechatronics.com 
 */
/* TLC5940 Library by Alex Leone, https://code.google.com/archive/p/tlc5940arduino/
 *  You need to modify tlc_config.h located in the TLC5940 library 
 *  and change the value of the variable NUM_TLCS to the numbers of TLC5940 ICs connected
 */
#include "Tlc5940.h" 
int stage = 0;
int randomNumber;
int count = 0;
int brightness = 3500;
int brightUp = 50;
int dir=1;
void setup() {
  Tlc.init();
}
void loop() {
  
  switch(stage) {    
    //-----Stage 1
    case 0:
      randomNumber = (int)random(0,31);
      Tlc.set(randomNumber,4095);
      delay(1500);
      Tlc.update();
      if(count >= 8) { 
        stage = 1;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 2
    case 1:
      delay(75);
      for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        delay(100);
        Tlc.update();
      }
      delay(500);
      Tlc.clear();
      Tlc.update();
      stage = 2;
      delay(500);
    break;
    //-----Stage 3
    case 2:
      for(int i=0;i<=31;i++) {
        Tlc.set(i,4095);
      }
      Tlc.update();
      delay(500);
      Tlc.clear();
      Tlc.update();
      delay(350);
      if(count > 6) { 
        stage = 3;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 4
    case 3:
      for (int i=0;i<=15;i++) {
        Tlc.set(i,4095);
        Tlc.set(31-i,4095);
        Tlc.update();
        delay(70);
      }
      delay(50);
      for (int i=15;i>=0;i--) {
        Tlc.set(i,0);
        Tlc.set(31-i,0);
        Tlc.update();
        delay(70);
      }
      for (int i=15;i>=0;i--) {
        Tlc.set(i,4095);
        Tlc.set(31-i,4095);
        Tlc.update();
        delay(70);
      }
      for (int i=0;i<=15;i++) {
        Tlc.set(i,0);
        Tlc.set(31-i,0);
        Tlc.update();
        delay(70);
      }
      delay(50);
      
      Tlc.clear();
      Tlc.update();
      delay(100);
      if(count > 1) {
        stage = 4;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 5
    case 4:
      for (int i=15;i>=count;i--) {
        Tlc.set(32-i,4095);
        Tlc.update();
        delay(5);
        Tlc.set(32-i-1,0);
        Tlc.update();
        delay(5);
        Tlc.set(i,4095);
        Tlc.update();
        delay(5);
        Tlc.set(i+1,0);
        Tlc.update();
        delay(50);
      }
      if(count > 15) {
        Tlc.set(16,4095);
        Tlc.update();
        delay(2000);
        stage = 5;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 6
    case 5:
      for (int i=0;i<=31;i++) {
        Tlc.set(i,brightness);
        Tlc.update();
      }
      Tlc.update();
      brightness = brightness + brightUp;
      if (brightness>=3500) {
        brightUp=-50;
        ++count;
      }
      if (brightness<=150) {
        brightUp=50;
      }
      if(count > 6) { 
        stage = 6;
        count = 0;
        brightness = 3500;
        Tlc.clear();
        Tlc.update();
      }
      delay(40);
    break;
    //-----Stage 7
    case 6:
      for (int i=0;i<=30;i+=2) {
        Tlc.set(i,4095);
        Tlc.set(i+1,0);        
      }
      Tlc.update();
      delay(500);
      for (int i=0;i<=30;i+=2) {
        Tlc.set(i,0);
        Tlc.set(i+1,4095);       
      }
      Tlc.update();
      delay(500); 
      if(count > 20) {
        stage = 7;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 8
    case 7:
      for(int i=31;i>=16;i--) {
        Tlc.clear();
        Tlc.update();
        delay(2);
        Tlc.set(i,4095);
        Tlc.set(i+1,2000);
        Tlc.set(i+2,1000);
        Tlc.set(i+3,500);
        Tlc.set(i+4,300);
        Tlc.set(i+5,200);
        Tlc.set(i+6,100);
        Tlc.set(i+7,50);
        Tlc.set(i+8,0);
        Tlc.set(i-16,4095);
        Tlc.set(i-15,2000);
        Tlc.set(i-14,1000);
        Tlc.set(i-13,500);
        Tlc.set(i-12,300);
        Tlc.set(i-11,200);
        Tlc.set(i-10,100);
        Tlc.set(i+-9,50);
        Tlc.set(i-8,0);
        
        Tlc.update();
        delay(50); 
      }
      if(count > 8) {
        for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        Tlc.update();
        delay(50);
        }
        stage = 8;
        count = 0;
      }
      else {
        ++count;
      }
    break;
    //-----Stage 9
    case 8:
      for(int i=31;i>=0;i--) {
        Tlc.set(i+8,4095);
        Tlc.set(i+7,2000);
        Tlc.set(i+6,1000);
        Tlc.set(i+5,500);
        Tlc.set(i+4,300);
        Tlc.set(i+3,200);
        Tlc.set(i+2,100);
        Tlc.set(i+1,50);
        Tlc.set(i,0);
        Tlc.update();
        delay(50);
      }
      for(int i=31;i>=0;i--) {
        Tlc.set(i,4095);
        }
      Tlc.update();
      delay(10);
      if(count > 8) {
        delay(8000);
        Tlc.clear();
        Tlc.update();
        stage = 0;
        count = 0;
      }
      else {
        ++count;
      }
    break;
      
  }
}

Malti:
it shows the same error that it is unable to compile with arduino uno.

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Malti:
the same problem is happening with another code that i have now mentioned i got this code from;

When you encounter an error you'll see a button on the right side of the orange bar "Copy error messages". Click that button. Paste the error in a message here USING CODE TAGS (</> button on the toolbar).

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

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

                ^

Multiple libraries were found for "IRremote.h"
 Used: C:\Users\VAIO\Documents\Arduino\libraries\IRremote
 Not used: C:\Program Files (x86)\Arduino\libraries\RobotIRremote
exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

this is error showing for ir sensor controlled.......

and this is for led heart

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

C:\Users\VAIO\Desktop\led_heart\led_heart.ino:9:22: fatal error: Tlc5940.h: No such file or directory

 #include "Tlc5940.h" 

                      ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

i downloaded the library tlc5940 h by alex leone and included it and it showednthe following error......

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_animations.h:30:0,

                 from C:\Users\VAIO\Desktop\led_heart\led_heart.ino:2:

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:27: error: variable or field 'tlc_setGSfromProgmem' declared void

 void tlc_setGSfromProgmem(prog_uint8_t *gsArray);

                           ^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:27: error: 'prog_uint8_t' was not declared in this scope

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:41: error: 'gsArray' was not declared in this scope

 void tlc_setGSfromProgmem(prog_uint8_t *gsArray);

                                         ^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:27: error: variable or field 'tlc_setGSfromProgmem' declared void

 void tlc_setGSfromProgmem(prog_uint8_t *gsArray)

                           ^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:27: error: 'prog_uint8_t' was not declared in this scope

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:41: error: 'gsArray' was not declared in this scope

 void tlc_setGSfromProgmem(prog_uint8_t *gsArray)

                                         ^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Malti:

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

OK, time for the nuclear option. Delete C:\Program Files (x86)\Arduino\libraries\RobotIRremote. That stupid library has caused so much trouble for so many people.

Malti:

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:27: error: 'prog_uint8_t' was not declared in this scope

The problem is that library uses non-standard progmem types that are no longer supported by new versions of the compiler. This is such a common problem that it is explained in the FAQ:

Basically you need to go through the library source code and everywhere you see something like prog_uint8_t you change it to const uint8_t PROGMEM.

It's too bad Sparkfun hasn't bothered to to update their library but nobody has reported the issue so maybe they just don't know about it.

pert:
OK, time for the nuclear option. Delete C:\Program Files (x86)\Arduino\libraries\RobotIRremote.

i cant understand that

if i have gotta delete it than how would i add it ,,,,,,i mean do i need to reinstall or is there anything else..

pert:
Basically you need to go through the library source code and everywhere you see something like prog_uint8_t you change it to const uint8_t PROGMEM.

i tried to find prog_uint8_t and replace it with uint8_t PROGMEM. but i was unable to find and replace......

pls someone help i am making this as to gift it to my friend but ....n the only 5 days are left..

Malti:
i cant understand that

Just follow my instructions:

pert:
Delete C:\Program Files (x86)\Arduino\libraries\RobotIRremote.

Malti:
if i have gotta delete it than how would i add it ,,,,,,i mean do i need to reinstall or is there anything else.

No. Here's the problem. There are two libraries that contain a file named IRremote.h. One is the IRremote library that you installed via Library Manager following my instructions. That's the one you want to use. There's this other worthless library called RobotIRremote included with the Arduino IDE. It's for this crappy Arduino robot thing that nobody has but it constantly causes conflicts with the very popular IRremote library. I was trying to find a solution that would make the Arduino IDE choose the right library but for some reason it's not working for you so the best solution is to just delete the RobotIRremote that you will never use.

Malti:
i tried to find prog_uint8_t and replace it with uint8_t PROGMEM. but i was unable to find and replace......

You didn't try very hard. The file names and line numbers are listed right in the error messages you posted, try actually reading them:

Malti:
i downloaded the library tlc5940 h by alex leone and included it and it showednthe following error......

Arduino: 1.8.1 (Windows 7), Board: "Arduino/Genuino Uno"

In file included from C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_animations.h:30:0,

from C:\Users\VAIO\Desktop\led_heart\led_heart.ino:2:

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:27: error: variable or field 'tlc_setGSfromProgmem' declared void

void tlc_setGSfromProgmem(prog_uint8_t *gsArray);

^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:27: error: 'prog_uint8_t' was not declared in this scope

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:32:41: error: 'gsArray' was not declared in this scope

void tlc_setGSfromProgmem(prog_uint8_t *gsArray);

^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:27: error: variable or field 'tlc_setGSfromProgmem' declared void

void tlc_setGSfromProgmem(prog_uint8_t *gsArray)

^

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:27: error: 'prog_uint8_t' was not declared in this scope

C:\Users\VAIO\Documents\Arduino\libraries\SparkFun_TLC5940\src/tlc_progmem_utils.h:68:41: error: 'gsArray' was not declared in this scope

void tlc_setGSfromProgmem(prog_uint8_t *gsArray)

^

exit status 1
Error compiling for board Arduino/Genuino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

the codes have been compiled successfully.........

i
a)opened basic use>tlc5940>examples>file......
b)copied the text #include "SparkFun_Tlc5940.h"
c)opened the sketch which showed the error
d)removed #include "Tlc5940.h"
e)and pasted the text there

and its working fine

and in another one pert mentioned it right that theres a library which is causing this problem as actually by mistake i added both of them in the sketch and now that i have removed it its working fine ..........

thanks for replying:) :slight_smile: