Hi guys,
I'm new in Arduino's World.
I'm trying to turn on or off my led with a remote IR control (like the device i use to control my TV).
I read that the standard IR library included in arduino doesn't work well, so I switched that library with the <IRremote.h> library.
It's working fine, but I encountered some troubles with the decode; I tried to use my IR device to turn on my LED but with a distance of 50cm it doesn't work. Arduino read the IR signal (rx led works) but my serial monitor doesn't show anything decoded (only FFFFFFF).
I use this code:
#include <IRremote.h>
int RECV_PIN = 3; // the pin where you connect the output pin of TSOP4838
int LED = 7;
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup()
{
Serial.begin(9600); // you can comment this line
irrecv.enableIRIn(); // Start the receiver
pinMode(LED, OUTPUT);
}
void loop() {
if (irrecv.decode(&results)) {
// unsigned int value = results.value;
digitalWrite(LED, HIGH); // turn it ON when button is pressed
Serial.println(value); // you can comment this line
irrecv.resume(); // Receive the next value
}
}
According to you, what could be the problem ? The IR decoder linked to arduino? The signal is received but is not decoded!
Sorry for my bad english, I'm italian.
Thank you,
Andrea.