Lightweight Arduino IR library for normal NEC protocol remote control devices.
If you have one of these cheap remote control units, with a matching IR receiver, you may find this library useful. It is specifically designed for the NEC IR protocol. Unlike the standard IR library, it does not use a timer and instead uses external interrupts. Its design based on a state machine model.
When compiled for a Uno, it uses 214 bytes of global variables and 3356 bytes of program storage space which is about half of the storage requirements of the more comprehensive standard Arduino IR library.
I've tested it on a Uno, an ATtiny841 (8 MHz internal) and a NodeMCU ESP8266. With the AVR processors, you are restricted on which pins you can use because of the external interrupts. If you cannot use an external interrupt pin, it should, however, not be too difficult to modify the code to use pin change interrupts instead.
I Found my problem. I am using the example using the "lightweight IR library" with a ESP-32 Wroom-32D. First time I testes it there was not a problem up loading the code. I connected the sensor and all went well. When I did a minor change to the code It refused to upload again, and again. I tried everything, even using a new ESP, sensor and new USB cable. FINALLY FIXED by removing the sensor from Port 2, IO02,... I do not know why, but this fixed it. Does anyone know why ????
Its not clear if you really mean that it is an uploading issue, a compilation issue or merely that the code does not work. Anyway, it appears you already have some sort of solution.
That library is only an IR receiver. It cannot send IR data. Further, it can only receive data from remote control devices which use the NEC protocol. The NEC protocol is very common, especially for cheap devices such as illustrated in the OP, but it is certainly not the only one.