Skip to content

Commit adfbfc9

Browse files
committed
Documentation by Ken Shirriff
1 parent dfe66ad commit adfbfc9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/ir_NEC.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,10 @@ bool IRrecv::decodeNEC() {
319319
* To convert one into the other, you must reverse the byte positions and then reverse all bit positions of each byte.
320320
* Or write it as one binary string and reverse/mirror it.
321321
* Example:
322-
* 0xCB340102 byte reverse -> 02 01 34 CB bit reverse-> 40 80 2C D3. Bit reverse e.g. for CB = 1100 1011 -> (reverse/mirror bits) 1101 0011 = D3.
322+
* 0xCB340102 byte reverse -> 02 01 34 CB bit reverse-> 40 80 2C D3.
323+
* 0xCB340102 is binary 11001011001101000000000100000010.
324+
* 0x40802CD3 is binary 01000000100000000010110011010011.
325+
* If you read the first binary sequence backwards (right to left), you get the second sequence.
323326
*/
324327
void IRsend::sendNECMSB(uint32_t data, uint8_t nbits, bool repeat) {
325328
// Set IR carrier frequency

0 commit comments

Comments
 (0)