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
}
}
-
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– dlu2016年01月24日 17:21:30 +00:00Commented Jan 24, 2016 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– Pai2016年01月24日 20:03:03 +00:00Commented Jan 24, 2016 at 20:03
1 Answer 1
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
-
Can I know exactly where to edit and which lib filePai– Pai2016年01月24日 05:53:57 +00:00Commented Jan 24, 2016 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– Majenko2016年01月24日 11:29:29 +00:00Commented Jan 24, 2016 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– Pai2016年01月24日 20:08:47 +00:00Commented Jan 24, 2016 at 20:08
-
@AdithyaPai What is the library you are trying to use?Majenko– Majenko2016年01月24日 20:10:23 +00:00Commented Jan 24, 2016 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– Pai2016年01月25日 11:27:11 +00:00Commented Jan 25, 2016 at 11:27
Explore related questions
See similar questions with these tags.