IR library issue.

Hey guys. I'm trying to decode an IR signal using this program...

#include <IRLib.h>
#include <IRLibMatch.h>
#include <IRLibRData.h>
#include <IRLibTimer.h>


//Create a receiver object to listen on pin 11
IRrecv My_Receiver(12);


IRdecode My_Decoder;

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

void loop() {
//Continuously look for results. When you have them pass them to the decoder
  if (My_Receiver.GetResults(&My_Decoder)) {
    My_Decoder.decode();    //Decode the data
    My_Decoder.DumpResults(); //Show the results on serial monitor
    My_Receiver.resume();     //Restart the receiver
  }
}

But every time I try too, it incorrectly decodes it and even tries to decode it when the IR receiver isnt plugged in. It also gives me this error, though it is not fatal.

C:\Program Files (x86)\Arduino\libraries\IRLib\IRLib.cpp: In function 'unsigned char Pin_from_Intr(unsigned char)':

C:\Program Files (x86)\Arduino\libraries\IRLib\IRLib.cpp:927:45: warning: 'progmem' attribute ignored [-Wattributes]

const unsigned char PROGMEM attach_to_pin[]= {

^

Sketch uses 9388 bytes (29%) of program storage space. Maximum is 32256 bytes.
Global variables use 818 bytes (39%) of dynamic memory, leaving 1230 bytes for local variables. Maximum is 2048 bytes.

I'm starting to get really confused. Thanks!

Skrumb:
But every time I try too, it incorrectly decodes it and even tries to decode it when the IR receiver isnt plugged in.

]

This warning is a result of the compiler turning your C code into machine code. The warning is NOT the result of your program trying to decode an IR signal.

Possible fix:

  • Go to IRLib.cpp at C:\Program Files (x86)\Arduino\libraries\IRLib\
  • change the line
    "const unsigned char PROGMEM attach_to_pin[]= {"
    to
    "static const unsigned char PROGMEM attach_to_pin[]= {"

Skrumb:
Hey guys. I'm trying to decode an IR signal using this program...

#include <IRLib.h>

#include <IRLibMatch.h>
#include <IRLibRData.h>
#include <IRLibTimer.h>

//Create a receiver object to listen on pin 11
IRrecv My_Receiver(12);

IRdecode My_Decoder;

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

void loop() {
//Continuously look for results. When you have them pass them to the decoder
  if (My_Receiver.GetResults(&My_Decoder)) {
    My_Decoder.decode();    //Decode the data
    My_Decoder.DumpResults(); //Show the results on serial monitor
    My_Receiver.resume();    //Restart the receiver
  }
}



But every time I try too, it incorrectly decodes it and even tries to decode it when the IR receiver isnt plugged in. It also gives me this error, though it is not fatal. I'm starting to get really confused. Thanks!