Using the latest version of the IRremote library

I have the latest version of the IRremote library installed. I am using a SAMSUNG remote. I cannot use this function receiver.decode(&results). I have to use receiver.decode(). For the "1" button on my SAMSUNG remote, the hex value is E0E020DF. Which command do I use to tell if the received IR is that value?

What data type is the E0E020DF ?

Is it an integer, an array of chars or a String ?

Please post a sketch that illustrates reading the value

1 Like

Try IrReceiver.decodedIRData.address (0xE0E0) and IrReceiver.decodedIRData.command (0x20DF)

Sample:

void loop() {
  if (IrReceiver.decode() && IrReceiver.decodedIRData.protocol == SAMSUNG) {
      Serial.print((char)IrReceiver.decodedIRData.command);
    IrReceiver.resume();
  }
}

Further information:

I tried this:

#include <IRremote.h>

int irrecv_pin = A0;
IRrecv receiver(irrecv_pin);

void setup() {
Serial.begin(9600);
receiver.enableIRIn();
}

void loop() {
if (receiver.decode() && receiver.decodedIRData.protocol == SAMSUNG) {
Serial.println(receiver.decodedIRData.command);
receiver.resume();
}
}

Things were going fine until it stopped receiving IR signal. All the wirings are done correctly. The remote has enough battery power as tested from the multimeter. When I press any buttons on the remote, it does not receive any signal.

Here you can see a running example: sketch.ino - Wokwi Arduino and ESP32 Simulator

With the Wokwi simulation only the NEC protocol works.
Replace in your program NEC by SAMSUNG. Then it should also work with a Samsung remote control.

I have used the digital pin 2 for the example. No analog pin.

I tried it and it works fine. Thank you for the help.

Great. Then it would be nice if you mark the thread as solved.

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