Errors in IRremote

Hi,
I'm rather new on Arduino (I blew up my first yesterday :frowning: but still enjoying it).

Now i'm trying de use an infrared sensor and a remote control.
I'm using the library IRremote.h and tried it with different sketches.
They all result in the same error messages wich I don't understand.

IRremote.cpp.o: In function _GLOBAL__sub_I_receiver': IRremote.cpp:10: undefined reference to IRrecv::enableIRIn()'
IRremote.cpp:10: undefined reference to IRrecv::decode(decode_results*)' IRremote.cpp:10: undefined reference to IRrecv::resume()'
IRremote.cpp:10: undefined reference to `IRrecv::IRrecv(int)'
collect2: error: ld returned 1 exit status

Can anybody help me to understand what is wrong?

Paul

not with out seeing the code you are trying to use.

The library is unhappy with something you are doing. look at a example in the library to see how the enable, decode, resume and irrecv is used

Did you install the whole library, (all files), or just the "IRremote.h" file?

Hi,

I used the library and the code from https://brainy-bits.com/tutorials/ir-remote-arduino/
The Library is the set with IRremote.h, IRremoteInt.h and IRremote.cpp.

This is the code I copied

#include "IRremote.h"

int receiver = 11; // Signal Pin of IR receiver to Arduino Digital Pin 11

/-----( Declare objects )-----/
IRrecv irrecv(receiver); // create instance of 'irrecv'
decode_results results; // create instance of 'decode_results'

void setup() /----( SETUP: RUNS ONCE )----/
{
Serial.begin(9600);
Serial.println("IR Receiver Button Decode");
irrecv.enableIRIn(); // Start the receiver

}/--(end setup )---/

void loop() /----( LOOP: RUNS CONSTANTLY )----/
{
if (irrecv.decode(&results)) // have we received an IR signal?

{
translateIR();
irrecv.resume(); // receive the next value
}
}/* --(end main loop )-- */

/-----( Function )-----/
void translateIR() // takes action based on IR code received

// describing Remote IR codes

{

switch(results.value)

{

case 0xFF629D: Serial.println(" FORWARD"); break;
case 0xFF22DD: Serial.println(" LEFT"); break;
case 0xFF02FD: Serial.println(" -OK-"); break;
case 0xFFC23D: Serial.println(" RIGHT"); break;
case 0xFFA857: Serial.println(" REVERSE"); break;
case 0xFF6897: Serial.println(" 1"); break;
case 0xFF9867: Serial.println(" 2"); break;
case 0xFFB04F: Serial.println(" 3"); break;
case 0xFF30CF: Serial.println(" 4"); break;
case 0xFF18E7: Serial.println(" 5"); break;
case 0xFF7A85: Serial.println(" 6"); break;
case 0xFF10EF: Serial.println(" 7"); break;
case 0xFF38C7: Serial.println(" 8"); break;
case 0xFF5AA5: Serial.println(" 9"); break;
case 0xFF42BD: Serial.println(" *"); break;
case 0xFF4AB5: Serial.println(" 0"); break;
case 0xFF52AD: Serial.println(" #"); break;
case 0xFFFFFFFF: Serial.println(" REPEAT");break;

default:
Serial.println(" other button ");

}// End Case

delay(500); // Do not get immediate repeat

} //END translateIR

Where are the library files installed?

On my Raspberry in the map /home/pi/sketchbook/libraries where I keep all the self-installed libraries

When posting code or error messages, it should always be done between code tags, not inline. Code tags can be generated with the </> button in the "Reply" window.
Or you can type them manually, with code and /code , both in square brackets.

Edit: It's best to put each statement on a separate line, too, for readability.

Edit2: The code compiles fine. It's definitely a problem with your library installation.

Hi,

Downloaded the stable-version of the Github libraries en now the problem seems te be solved.

thans all for your help

Paul