Irrecv entire class explanation

Hello everybody,

Stupid question but does someone know where I can find all the relevant information about the class IRrecv used for infrared remote control projects?

I could find some trace and forum topics but nothing standard from Arduino...

Thanks a lot

Kind Regards

Guillaume

Hello guimsonusbambinus

Take a view here:

https://arduino-irremote.github.io/Arduino-IRremote/classIRrecv.html

hth

1 Like

Maybe that's because the library isn't from Arduino but by Ken Shirriff et al.

What is relevant? That' usually quite subjective...
May I suggest that you ask the question you want to know?

yeah, it's third party

there is some information in the GitHub and the Receiving IR codes paragraph

the library went through extensive changes over the past couple years and so don't focus on older examples or documentation as it might not be relevant anymore

Dear Arduino colleagues,

Thank you again for your quick answers :slight_smile:

I am facing a strange behaviour using the remote control: when pushing on any key of the remote control it display the hexadecimal "FFFFFFFF" when it should display the hexadecimal according to the key pressed.
When reading the explanation, they say : "If the key time is too long, FFFFFFFF is prone to garbled characters "
I am not sure to understand this exactly: I press the key too long compared to computer time ?

Attached picture of the IR remote control hexadecimal key-


notation
Thanks a lot

post your code and a diagram of your circuit

Hello JML,

First of all thank you for quick response and help!

I have attached an extension of the code hereunder. This extension exercice should do nothing else than lighting a LED when pushing the key "OK". I observe that the LED never goes ON or OFF when pushing ANY key as it always stores "FFFFFF" as result recieved on the IR reciever. So somehow the IR reciever does not translate the signal correctly? Or more probably; I am doing a syntax error in the IF statement with hex decimal notation but I have no direct idea how to solve it.

Regarding the wiring, there is no specific wiring done by my own hands: there is only a IR reciever pre-installed on the board and I have a remote key to press any key. Note that each time I press a key, the led of the IR reciever goes instantenously ON and OFF proving that the signal is effectively detected.

I will attach a picture for clarification. I did not show the effective LED that should go ON and OFF; this LED is wired correctly (trust me) and somehow hidden on my picture (sorry for that)

Hope this is clear for you

Thanks a lot

Guillaume
ir_remote_control.ino (1,5 KB)

Oh sorry I attached the wrong code: here is the correct code.
ir_remote_control.ino (1,6 KB)

post directly in the forum with code tags please

Dear JML,

Here it is (however I do not understand what you exactly mean with code tags):

/* 4WD Bluetooth Robot Car V2.0 Kit
Project 6 IR remote control
lesson 6.1 & 6.2
Written by Guillaume Masure
*/

// Include librairies and define global variables

#include <IRremote.h>
int RECV_PIN = 3; //define the pin of IR receiver as D3
int LED_PIN = 9;
int a = 0;
IRrecv irrecv(RECV_PIN);
decode_results results; //decoding results will be written in results variable of type decode results

void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); //Enable/Activate reciever
pinMode(LED_PIN,OUTPUT);
}

// Project 6.2 with LED connected to key -> Run the code below

void loop() {
if (irrecv.decode(&results))
{
if (results.value==0xFF02FD && (a==0)) // press one time on key "OK" LED will go ON
{
Serial.println("HIGH");
digitalWrite(LED_PIN,HIGH);
a = 1; //store/memorize the high value of led here inside
}
else if (results.value==0xFF02FD && (a==1)) // press again key OK LED will go OFF
{
Serial.println("LOW");
digitalWrite(LED_PIN,LOW);
a = 0; //store the low value of led here inside
}
irrecv.resume();
}
Serial.println(results.value,HEX);
delay(100);
}

Please - please read How to get the best out of this forum and modify your post accordingly (including code tags and necessary documentation for your ask like the circuit, links to your exact remote etc ).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.