The IR remote library includes an exhaustive collection of examples which demonstrate how to send and receive
IR signals. To test out the receiver, open up the
IRrecvDumpV2
example by navigating to the File > Examples >
Examples from Custom Libraries > IRremoteESP8266 menu.
Before uploading the sketch, you need to
modify the
RECV_PIN
pin definition on line 39. This sets the ESP8266
pin connected to your IR receiver. Set it to
13
.
#define RECV_PIN 13
Once that modification has been made, upload away! (Make sure the board is set correctly to “NodeMCU 1.0
(ESP-12E Module)”.) Then open up the serial monitor and set the baud rate to 115200.
You should see a “IRrecvDumpV2 is now running and waiting for IR input on Pin 13” message print out. If you
don’t try tapping the board’s reset button.
Then aim an IR remote at the board and hit a button. You should see a stream of data shoot by.
Click the image for a closer look.
The most important bits of this output are the last 4 lines, which should look a lot like C variable declarations. For
example: