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

Method sendRaw

src/IRSend.hpp:400–421  ·  view source on GitHub ↗

* Sends a 16 byte microsecond timing array. * Raw data starts with a Mark. No leading space as in received timing data! */

Source from the content-addressed store, hash-verified

398 * Raw data starts with a Mark. No leading space as in received timing data!
399 */
400void IRsend::sendRaw(const uint16_t aBufferWithMicroseconds[], uint_fast16_t aLengthOfBuffer, uint_fast8_t aIRFrequencyKilohertz) {
401// Set IR carrier frequency
402 enableIROut(aIRFrequencyKilohertz);
403
404 DEBUG_PRINT(F("aPGMBufferWithMicroseconds=0x"));
405 DEBUG_PRINT((uint32_t) aBufferWithMicroseconds, HEX);
406 DEBUG_PRINT(F(" [0]="));
407 DEBUG_PRINTLN(aBufferWithMicroseconds[0]); // this crashes on ESP8266 if aBufferWithMicroseconds is PROGMEM
408 DEBUG_FLUSH();
409
410 /*
411 * Raw data starts with a mark.
412 */
413 for (uint_fast16_t i = 0; i < aLengthOfBuffer; i++) {
414 if (i & 1) {
415 // Odd
416 space(aBufferWithMicroseconds[i]);
417 } else {
418 mark(aBufferWithMicroseconds[i]);
419 }
420 }
421}
422/*
423 * Version with repeat
424 * @param aRepeatPeriodMillis - Time between start of two frames. Thus independent from frame length.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected