Hey everyone, I recently got an ESP32 nano board for a little project. I do not want to go into too many details, but I have an IR receiver on my breadboard receiving 5V. It's connected to my GPIO5 pin (D2), and whenever I use any remote with IR, my IR receiver flashes red.
The Problem:
For some reason, under the scope of loop(), my if statement for "if (receiver.decode(&results))" isn't being invoked. I have Serial.print in my code to debug the signal command, but the serial monitor is not showing anything. If I put Serial.print outside of the if scope, then it will show in the serial monitor. Another thing to note is that if I include a print statement in the setup, it also doesn't appear in the serial monitor. I'm not sure why. I will include the code and pictures of my setup below in the Imgur link.
#include <IRremote.h>
// Define the GPIO pin connected to the IR receiver
int IR_RECEIVER_PIN = 5; // D2 pin on ESP32 nano
IRrecv receiver(IR_RECEIVER_PIN);
decode_results results;
void setup() {
Serial.begin(9600); // Initialize serial communication
receiver.enableIRIn(); // start up receiver
}
void loop() {
if (receiver.decode(&results)) { // Check if an IR signal has been received
Serial.println(results.value, HEX);
receiver.resume(); // receive next value
}
Serial.println("Testing123");
}
The first picture and second picture are a little different, but the same problem occurs.
(I connected the GPIO5 pin directly to the bottom half of the breadboard where the IR Receiver sits).
I am not able to see the signal command in hexadecimal. The if statement doesn't even get invoked.