IRremote.hpp isn't use HEX truetly

Hey, I made a Arduino project right now and I have a problem. IRremote.hpp is read HEX's truetly but isn't use correctly these.

For example I have a IR receiver and a led. I want to when I press to 1 button at the RC led goes high, delay 500 and led goes low.

IRremote.hpp can read HEX's correctly but can't use correctly. For example I press another button and led goes high, delay 500, led goes low. But I want to when I press 1 and this will happen. But it also happens when I press any key.

Sorry for my English, I'm Turkish. Thanks for your helps. It's codes:

#include <IRremote.hpp>

#define RECV_PIN 11
#define LED_PIN 13
#define BUTTON_HEX_CODE 0xFFA25D

IRrecv irrecv(RECV_PIN);

void setup() {
  Serial.begin(9600);
  IrReceiver.begin(RECV_PIN, ENABLE_LED_FEEDBACK); 
  pinMode(LED_PIN, OUTPUT); }

void loop() {
  if (IrReceiver.decode()) {
    Serial.println(IrReceiver.decodedIRData.decodedRawData, HEX); 
    if (IrReceiver.decodedIRData.decodedRawData == BUTTON_HEX_CODE) {
      digitalWrite(LED_PIN, HIGH); 
      delay(500); // 500 milisaniye bekle
      digitalWrite(LED_PIN, LOW); 
    } else {
      digitalWrite(LED_PIN, LOW); 
    }
    IrReceiver.resume(); 
  }
}

What happens if you disable LED feedback? That may be interfering with your own code's use of the LED.

It's working. Thank you very much bro :slight_smile:

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