0

Whenever I compile irrecvdemo of or remote library it gives error saying that fatal error saying

no file or directory exists #include <WProgram.h>

#include <IRremote.h>

int RECV_PIN = 11;

IRrecv irrecv(RECV_PIN);

decode_results results;

void setup()
{
  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop() {
  if (irrecv.decode(&results)) {
    Serial.println(results.value, HEX);
    irrecv.resume(); // Receive the next value
  }
}
2
  • Welcome! It sounds like you've got a syntax error in your sketch. If you include your code it will be much easier to help you.
    – dlu
    Jan 24 '16 at 17:21
  • #include <IRremote.h> int RECV_PIN = 11; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { Serial.begin(9600); irrecv.enableIRIn(); // Start the receiver } void loop() { if (irrecv.decode(&results)) { Serial.println(results.value, HEX); irrecv.resume(); // Receive the next value } }
    – Pai
    Jan 24 '16 at 20:03
2

You are using a very old library on a modern IDE. The file that was called WProgram.h in IDE version 0023 and below is now called Arduino.h. You will need to change any references to WProgram.h to Arduino.h instead.

Well written libraries do this with a #ifdef block:

#if (ARDUINO >= 100)
# include <Arduino.h>
#else
# include <WProgram.h>
#endif
8
  • Can I know exactly where to edit and which lib file
    – Pai
    Jan 24 '16 at 5:53
  • I can't really tell you that, no, you will have to find it for yourself. You will need to find where you installed the library to and look in the files included with it. There may be only 2 - a .cpp and a .h file - or there may be more. There may be a "utility" folder with more in as well. The include will always be near the top of the files though, so it should be easy to spot. Depending on your operating system you may have the facility to search for files with certain words in them - for instance on Linux and OS X there is the grep command line utility. Not sure what is on Windows.
    – Majenko
    Jan 24 '16 at 11:29
  • I found those files and copied that codes which you gave,I tried on CCP file h file...I tried all combinations and used older version of ide also but it did not compile...
    – Pai
    Jan 24 '16 at 20:08
  • @AdithyaPai What is the library you are trying to use?
    – Majenko
    Jan 24 '16 at 20:10
  • IR remote library... Just using demo codes to get binary numbers from normal ir remote...by connecting ir receiver sensor tsop-...
    – Pai
    Jan 25 '16 at 11:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.