Go Down

Topic: Error with IRRemote (Read 3534 times) previous topic - next topic

Hello :). I bought one irremote. I tried to test with Arduino uno example IRRemote code.
The code:
Code: [Select]

#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
 }
}


Before.....It was another error in IRRemoteInt.h:
Code: [Select]

[There were some more lines, but I can't post more than 9500chars]
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp:400: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeSony(decode_results*)':
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp:433: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp:443: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp: In member function 'long int IRrecv::decodeRC5(decode_results*)':
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp:518: error: 'volatile struct irparams_t' has no member named 'rawlen'
C:\Documents and Settings\dominik\Desktop\arduino-1.0\libraries\IRremote\IRremote.cpp:529: error: 'volatile struct irparams_t' has no member named 'rawlen'


But I fixed it:
Code: [Select]

Note for Arduino 1.0
I haven't had time to update the library yet, but several helpful people have told me that to use the library with Arduino 1.0, you need to change
#include <WProgram.h>
to
#include <Arduino.h>
in IRRemoteInt.h

I found this fix on http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
but now.....I have another error.... :(
Code: [Select]

avr-gcc: IR.cpp.o: No such file or directory
avr-gcc: IRremote\IRremote.cpp.o: No such file or directory


Where is the error? Is it in the example code for IRRemote or in IRRemote.h or IRRemoteInt.h?

PaulS

Quote
Where is the error?

You ignored all the compiler output. The compiler failed to compile the code, so the linker can not find the appropriate .o files.

You must fix all the compiler errors before you worry about linker errors.

Lol :D I tried to upload it 17-times, and now it's working :D

Jihadabdullah1991

I have the same problem ! :(

Can you help me please for a good code with no errors !

JimboZA

#4
Sep 07, 2014, 02:38 pm Last Edit: Sep 07, 2014, 02:51 pm by JimboZA Reason: 1

I have the same problem ! :(

Can you help me please for a good code with no errors !


The IRremote library's examples are "good code with no errors".

I downloaded the library to my new laptop from github just 2-3 days ago and installed it. Every example (see screenshot) compiles, as does code of my own using that library and which I wrote about 2 years ago on old laptop.

So you'll need to be very specific about what your exact problem is.....

edit....the issue of Wprogram.h vs Arduino.h has gone away with a few lines of code in the library now, which detects the ide and uses the correct header.

Code: [Select]
#if defined(ARDUINO) && ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif
My hovercraft is full of eels.

No PMs for help please.
DO NOT power servos from Arduino 5V: give them their own power and connect the grounds.

Go Up