I recelntly started trying with the IR-receiver but it doesn't work really well

so i tried this code with my irl irreceiver but i only got F00000 back and now i tried it on tinkercad but it's the same thing. i've followed two separate tutorials and both didn't work. any idea what i'm doing wrong? The irremote library is working as far as i know. i've tried to pput the signal pin in analog and digital already.

#include <IRremote.h>
const int RECV_PIN = A1;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup(){
  Serial.begin(9600);
  irrecv.enableIRIn();
  irrecv.blink13(true);
}

void loop(){
  if (irrecv.decode(&results)){
        Serial.println(results.value, HEX);
        irrecv.resume();
  }
}

are you using an UNO R4 Minima or a plain old Uno R3?
the IRremote library has gone through extensive changes, not sure which version is used with tinkercad versus the one you could have on your computer.

Not having a current limiting resistor for your red Led is not good...

also have you read the library's documentation?

tinkercad uses the uno R3

why did you post in the UNO R4 Minima category then?

because there wasn't an R3 category as far as i know. And my own arduino was an R4.

You could have posted in the project guidance or programming questions category . We could move it there

—-

So what’s the issue ? That the simulation does not work or that your real world system does not work?

Use the latest library version and the example ReceiveDemo and you will be lucky!

With the latest version of the library try this code with the serial monitor opened at 115200 bauds

#include <IRremote.hpp> 
const byte irPin = A1;

void setup() {
  Serial.begin(115200);
  IrReceiver.begin(irPin);
}

void loop() {
  if (IrReceiver.decode()) {
    Serial.print("command = "); Serial.println(IrReceiver.decodedIRData.command);
    IrReceiver.resume(); 
  }
}

it worked! thanks!

good

@noobwithadream Show some gratitude, give @J-M-L the solution tickbox!

that's OK - I'm not contributing on the forum for "gratitude" - I find it nice to help out where I can.

We know. Few of us are here for the tickies - but it also indicates to future readers that this thread has a solution, which leads them to understand that 'there is hope'.

OK I gave you the tick then :slight_smile:

1 Like

sry, i'm new and i didn't know such a thing existed. found it though.

1 Like