I jacked one of the IR receivers from my LED strip and hooked it up to my ESP8266 NodeMCU (running Arduino code). I found a great library called IRremoteESP8266. With this library, I can basically receive and send IR signals. However, the HEX values I get in are different from the NEC values I have to send out.

Here's what I've got:

Serial.println((uint32_t) (results.value & 0xFFFFFFFF), HEX);

When I compile this and I open the Serial Monitor, I get D7E84B1B when I press the button on my remote. I searched for it on Google, and I found a site that shows this:

‘real’ decode: FF02FD, hash decode: D7E84B1B

So naturally I tried doing:

irsend.sendNEC(0x00FF02FD, 32);

and it works just fine. The code example for receiving and sending can be found on the repository.

How do I make a conversion between what I receive and what I send, so I can basically mirror what I do?


According to the website I got the real NEC value from, they simply do:

Serial.print(results.value, HEX);

However, when I try to do that, I get this error:

call of overloaded 'println(uint64_t&, int)' is ambiguous

I know they are different projects, but the ESP8266 project I use is based off the IRremote library, which they seem to use.

  • There is a comment in the linked receiving code: // print() & println() can't handle printing long longs. (uint64_t) you could just try casting it back to uint32_t - Serial.print((uint32_t)results.value, HEX); – Kingsley Sep 13 '18 at 6:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.