dennisfrett / Arduino-Direct-NEC-Transmitter

This Arduino library can be used to emit NEC without a carrier wave. This is useful to send IR NEC commands without an infrared led directly over a wire, typically into 3.5mm / 2.5mm headphone jack.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Help with NEC input

curtisd0886 opened this issue · comments

Hello,
I am trying to use your code to send an IR signal though a 3.5 mm cable. The NEC code that I am trying to send is 0x40F740BF (32 Bits). How would I send that using the necTransmitter.SendNEC() command? When I try inputing the hex code as is I get an error message.

Hi Curtis. As explained here, a NEC command is actually 16 bit, not 32 bit. That's why the API expects 2 (address + command) 8 bit values.

In your case, your input 0x40F740BF translates in binary to 0b01000000111101110100000010111111, which doesn't seem fully correct.

The command is 0b01000000 (the last part 0b10111111 is the inverse), which translates to 0x40 or 64.
The 16 address bits don't match op though, the first 8 bits are not the logical inverse of the next 8 bits, are you sure the input is correct?

Given the address is correct (and the logical inverse incorrect), the command for you would be:

SendNEC(0x40, 0x40)

I hope this helps.