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
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-
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)
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
// 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 ).