MCPcopy Create free account
hub / github.com/Arduino-IRremote/Arduino-IRremote / sendNECMSB

Method sendNECMSB

src/ir_NEC.hpp:394–409  ·  view source on GitHub ↗

* With Send sendNECMSB() you can send your old 32 bit codes. * To convert one into the other, you must reverse the byte positions and then reverse all bit positions of each byte. * Use bitreverse32Bit(). * Or write it as one binary string and reverse/mirror it. * Example: * 0xCB340102 byte reverse -> 02 01 34 CB bit reverse-> 40 80 2C D3. * 0xCB340102 is binary 110010110011010000000001000000

Source from the content-addressed store, hash-verified

392 * If you read the first binary sequence backwards (right to left), you get the second sequence.
393 */
394void IRsend::sendNECMSB(uint32_t data, uint8_t nbits, bool repeat) {
395 // Set IR carrier frequency
396 enableIROut (NEC_KHZ);
397
398 if (data == 0xFFFFFFFF || repeat) {
399 sendNECRepeat();
400 return;
401 }
402
403 // Header
404 mark(NEC_HEADER_MARK);
405 space(NEC_HEADER_SPACE);
406
407 // Old version with MSB first Data + stop bit
408 sendPulseDistanceWidthData(NEC_BIT_MARK, NEC_ONE_SPACE, NEC_BIT_MARK, NEC_ZERO_SPACE, data, nbits, PROTOCOL_IS_MSB_FIRST);
409}
410
411/** @}*/
412#include "LocalDebugLevelEnd.h"

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected