Help with coding for my IR remote which uses NEC protocol


I am designing an IR remote using Arduino Nano and it is based on one of my fan remotes. The fan remote uses NEC protocol and by using the IR receiver module, I have decoded the IR signal sent by the remote. When I used the the IRsend Demo from Ken Sheriff's IR remote library, it worked perfectly fine. But it doesn't seem to work properly when I upload my codes.

The IR LED sends IR signals without pressing the button itself and the signal sent from the IR LED is 0x807FD02F, but the decoder using IR receiver shows a different HEXADECIMAL value. Can anyone please help me?

You should post your entire code. Post it between code tags.
You have a 5 second delay in the loop where the button press is detected. This will make the button seem very unresponsive.

It works now :slight_smile: