so i am trying to read the codes from my ir remote but the whatever button i press it does nothing but randomly it just prints a seemingly random code
heres the code im using
#include <IRremote.h>
#include <ir_Lego_PF_BitStreamEncoder.h>
const int RECV_PIN = 11; // Connect your IR receiver's OUT to pin 11
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
Serial.begin(9600);
irrecv.enableIRIn(); // Start the receiver
}
void loop() {
if (irrecv.decode(&results)) {
Serial.print("IR Code: ");
Serial.println(results.value, HEX); // Print code in hexadecimal
irrecv.resume(); // Receive the next value
}
}