IRremote.cpp Most common problem.

As per previous posts there is probably something amiss with your installation....IRremote is pretty robust

...however, if you really want ot try another library, check out IRLib which is a re-write of IRremote.

Thanks this really helped, this library compiles. Now I need the code which will print in serial monitor the received ir signal, I did some research and couldn't find nothing interesting. Do you know any tutorials which could help me with that, or which will help me learn useful stuff about arduino ?

google is your friend....there is a website & git for IRLib which includes many example pieces of code & I would be surprised if one of them didn't provide an answer to you question.

I cant find nothing what I need. I found this code but I don't know how to make it to turn led on or off . And I don't know how tu understand the output in serial monitor. Could you advice me something ?

#include <IRLib.h>

IRrecv My_Receiver(0);//Use input pin 11

IRdecode My_Decoder;

void setup()
{

  Serial.begin(9600);//We will read the output on the serial monitor
	
  My_Receiver.enableIRIn(); // Start the receiver
	
}
	
void loop() {

  if (My_Receiver.GetResults(&My_Decoder)) {

    My_Decoder.decode();//decode the signal
	
    My_Decoder.DumpResults();//dump the results on the serial monitor
	
    My_Receiver.resume(); //restart the receiver
	
  }
 
	
}
Decoded Unknown: Value:0 (0 bits)
Raw samples(34): Gap:41540
  Head: m250  s1900
0:m200 s1900	1:m200 s1900		 2:m200 s850	3:m200 s850		 
4:m200 s850	5:m200 s1950		 6:m150 s850	7:m200 s1950		 
8:m150 s1950	9:m150 s1950		 10:m150 s900	11:m200 s850		 
12:m200 s1900	13:m150 s900		 14:m200 s850	15:m200
Extent=25500
Mark  min:150	 max:200
Space min:850	 max:1950

I used this website, but it doesn't give me answers to what I need :confused: IRLib Tutorial part 1: Hardware set up | CY's Tech Talk
And IRLib examples.

edit:
I used this example code:

/* Example program for from IRLib – an Arduino library for infrared encoding and decoding
 * Version 1.3   January 2014
 * Copyright 2014 by Chris Young http://cyborg5.com
 * Based on original example sketch for IRremote library 
 * Version 0.11 September, 2009
 * Copyright 2009 Ken Shirriff
 * http://www.righto.com/
 */
/*
 * IRhashdecode - decode an arbitrary IR code.
 * Instead of decoding using a standard encoding scheme
 * (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value.
 * This should produce a unique 32-bit number however that number cannot be used
 * to retransmit the same code. This is just a quick and dirty way to detect a unique code
 * for controlling a device when you don't really care what protocol or values
 * are being sent.
 */

#include <IRLib.h>

int RECV_PIN = 0;

IRrecv My_Receiver(RECV_PIN);
IRdecode My_Decoder;
IRdecodeHash My_Hash_Decoder;

void setup()
{
  My_Receiver.enableIRIn(); // Start the receiver
  Serial.begin(9600);
  delay(2000);while(!Serial);//delay for Leonardo
}

void loop() {
  if (My_Receiver.GetResults(&My_Decoder)) {//Puts results in My_Decoder
    My_Hash_Decoder.copyBuf(&My_Decoder);//copy the results to the hash decoder
    My_Decoder.decode();
    Serial.print("real decode type:");
    Serial.print(Pnames(My_Decoder.decode_type));
    Serial.print(" value: 0x");
    Serial.print(My_Decoder.value, HEX);
    My_Hash_Decoder.decode();
    Serial.print(", hash decode: 0x");
    Serial.println(My_Hash_Decoder.hash, HEX); // Do something interesting with this value
    delay(1000);
    My_Receiver.resume(); 
  }
}

and it outputs me :

real decode type:Unknown value: 0x0, hash decode: 0x7EBAE5F2
real decode type:Unknown value: 0x0, hash decode: 0x7E333CBA
real decode type:Unknown value: 0x0, hash decode: 0x2F103794
real ecode type:Unknown value: 0x0, hash decode: 0x84188DC1
real deode type:Unknown value: 0x0, hash decode: 0xC3D96F3D
real decoe type:Unknown value: 0x0, hash decode: 0x7FF05931
real decodetype:Unknown value: 0x0, hash decode: 0x7FF05930
real decode tpe:Unknown value: 0x0, hash decode: 0x7FF05931
real decode typ:Unknown value: 0x0, hash decode: 0xD5E127E5
real decode type:nknown value: 0x0, hash decode: 0xC4F4B7BE
real decode type:Unnown value: 0x0, hash decode: 0x679F01A5
real decode type:Unknwn value: 0x0, hash decode: 0xF5D196A0
real decode type:Unknown value: 0x0, hash decode: 0x1D0CEAF8
real decode type:Unknown alue: 0x0, hash decode: 0xCDB88D29
real decode type:Unknown value: 0x0, hash decode: 0x5ECD59FF
real decode type:Unknown valu: 0x0, hash decode: 0x5ECD59FF
real decode type:Unknown value:0x0, hash decode: 0x5ECD59FF
real decode type:Unknown value: 00, hash decode: 0x5ECD59FF
real decode type:Unknown value: 0x0 hash decode: 0x5ECD59FF
real decode type:Unknown value: 0x0, ash decode: 0x5ECD59FF
real decode type:Unknown value: 0x0, hah decode: 0x5ECD59FF
real decode type:Unknown value: 0x0, hashdecode: 0xD8B1016D
real decode type:Unknown value: 0x0, hash dcode: 0x5C86D15
real decode type:Unknown value: 0x0, hash decoe: 0x5ECD59FF
real decode type:Unknown value: 0x0, hash decode 0x5ECD59FF
real decode type:Unknown value: 0x0, hash decode: x5ECD59FF
real decode type:Unknown value: 0x0, hash decode: 0xECD59FF
real decode type:Unknown value: 0x0, hash decode: 0x5ED59FF
real decode type:Unknown value: 0x0, hash decode: 0xA489336
real decode type:Unknown value: 0x0, hash decode: 0xA489236
real decode type:Unknown value: 0x0, hash decode: 0xA4892337

How can I use this to make a remote control for 1 digital pin ?

Could Somebody reply ? ? ... :grin:

real decode type:Unknown value: 0x0, hah decode: 0x5ECD59FF
real decode type:Unknown value: 0x0, hashdecode: 0xD8B1016D

Those dropped characters don't look good.

kryku96:

Decoded Unknown: Value:0 (0 bits)

Raw samples(34): Gap:41540
 Head: m250  s1900
0:m200 s1900 1:m200 s1900 2:m200 s850 3:m200 s850
4:m200 s850 5:m200 s1950 6:m150 s850 7:m200 s1950
8:m150 s1950 9:m150 s1950 10:m150 s900 11:m200 s850
12:m200 s1900 13:m150 s900 14:m200 s850 15:m200
Extent=25500
Mark  min:150 max:200
Space min:850 max:1950

Using your captured info above...this is what your signal looks like.....(see attachment)

If you want to send this using IRLib you could try the following code (automatically generated by AnalysIR tool)

/*
Automatically Generated by AnalysIR - Batch Export Utility
Registered to: xxxxxxxx
Session History
Type : Key : Value : Bits
0 : RAW :  :  : 0
*/

// NB: Not all protocols are supported by IRremote or IRLib. You may need to edit the code below manually
// Automatically Generated by AnalysIR for xxxxxxxx, visit http://www.AnalysIR.com or email info@....... for further details
int khz=38; //NB Change this default value as neccessary to the correct modulation frequency


unsigned int Signal_0_0[] = {250,1900,200,1900,200,1900,200,850,200,850,200,850,200,1950,150,850,200,1950,150,1950,150,1950,150,900,200,850,200,1900,150,900,200,850,200,1000}; //AnalysIR Batch Export - RAW

My_Sender.IRsendRaw::send(Signal_0_0, sizeof(Signal_0_0)/sizeof(int), khz); //AnalysIR Batch Export - RAW
 // AnalysIR IR Protocol: RAW, Key:

You may have to adjust the modulation frequency in the following line:
int khz=38;//try 36,40,56 if it doesnt work with 38

As per the previous post re the missing characters in the data, does raise questions about physical issues with your arduino/setup.