IRremote
Receiving IR data for multiple protocols

Macros

#define FNV_PRIME_32   16777619
 used for decodeHash() More...
 
#define FNV_BASIS_32   2166136261
 used for decodeHash() More...
 

Functions

const char * getProtocolString (decode_type_t aProtocol)
 
void printIRResultShort (Print *aSerial, IRData *aIRDataPtr, bool aPrintRepeatGap)
 Function to print decoded result and flags in one line. More...
 
uint8_t bitreverseOneByte (uint8_t aValue)
 
uint32_t bitreverse32Bit (uint32_t aInput)
 
void IRReceiveTimerInterruptHandler ()
 
bool matchTicks (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
 Match function without compensating for marks exceeded or spaces shortened by demodulator hardware. More...
 
bool MATCH (uint16_t measured_ticks, uint16_t desired_us)
 
bool matchMark (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
 Compensate for marks exceeded by demodulator hardware. More...
 
bool MATCH_MARK (uint16_t measured_ticks, uint16_t desired_us)
 
bool matchSpace (uint16_t aMeasuredTicks, uint16_t aMatchValueMicros)
 Compensate for spaces shortened by demodulator hardware. More...
 
bool MATCH_SPACE (uint16_t measured_ticks, uint16_t desired_us)
 
int getMarkExcessMicros ()
 Getter function for MARK_EXCESS_MICROS. More...
 
void printActiveIRProtocols (Print *aSerial)
 
 IRrecv::IRrecv ()
 Instantiate the IRrecv class. More...
 
 IRrecv::IRrecv (uint_fast8_t aReceivePin)
 
 IRrecv::IRrecv (uint_fast8_t aReceivePin, uint_fast8_t aFeedbackLEDPin)
 Instantiate the IRrecv class. More...
 
void IRrecv::begin (uint_fast8_t aReceivePin, bool aEnableLEDFeedback=false, uint_fast8_t aFeedbackLEDPin=USE_DEFAULT_FEEDBACK_LED_PIN)
 Initializes the receive and feedback pin. More...
 
void IRrecv::setReceivePin (uint_fast8_t aReceivePinNumber)
 Sets / changes the receiver pin number. More...
 
void IRrecv::registerReceiveCompleteCallback (void(*aReceiveCompleteCallbackFunction)(void))
 Sets the function to call if a protocol message has arrived. More...
 
void IRrecv::start ()
 Start the receiving process. More...
 
void IRrecv::restartTimer ()
 
void IRrecv::enableIRIn ()
 Alias for start(). More...
 
void IRrecv::start (uint32_t aMicrosecondsToAddToGapCounter)
 Configures the timer and the state machine for IR reception. More...
 
void IRrecv::restartTimer (uint32_t aMicrosecondsToAddToGapCounter)
 
void IRrecv::startWithTicksToAdd (uint16_t aTicksToAddToGapCounter)
 
void IRrecv::restartTimerWithTicksToAdd (uint16_t aTicksToAddToGapCounter)
 
void IRrecv::addTicksToInternalTickCounter (uint16_t aTicksToAddToInternalTickCounter)
 
void IRrecv::addMicrosToInternalTickCounter (uint16_t aMicrosecondsToAddToInternalTickCounter)
 
void IRrecv::restartAfterSend ()
 Restarts receiver after send. More...
 
void IRrecv::stop ()
 Disables the timer for IR reception. More...
 
void IRrecv::stopTimer ()
 
void IRrecv::disableIRIn ()
 Alias for stop(). More...
 
void IRrecv::end ()
 Alias for stop(). More...
 
bool IRrecv::isIdle ()
 Returns status of reception. More...
 
void IRrecv::resume ()
 Restart the ISR (Interrupt Service Routine) state machine, to enable receiving of the next IR frame. More...
 
void IRrecv::initDecodedIRData ()
 Is internally called by decode before calling decoders. More...
 
bool IRrecv::available ()
 Returns true if IR receiver data is available. More...
 
IRDataIRrecv::read ()
 If IR receiver data is available, returns pointer to IrReceiver.decodedIRData, else NULL. More...
 
bool IRrecv::decode ()
 The main decode function, attempts to decode the recently receive IR signal. More...
 
bool IRrecv::decodePulseDistanceWidthData (uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroMarkMicros, bool aMSBfirst)
 Decode pulse distance width protocols. More...
 
bool IRrecv::decodePulseDistanceWidthData (uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros, uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst) __attribute__((deprecated("Please use decodePulseDistanceWidthData() with 6 parameters.")))
 
bool IRrecv::decodePulseDistanceWidthDataStrict (uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset, uint16_t aOneMarkMicros, uint16_t aZeroMarkMicros, uint16_t aOneSpaceMicros, uint16_t aZeroSpaceMicros, bool aMSBfirst)
 
bool IRrecv::decodePulseDistanceWidthData (PulseDistanceWidthProtocolConstants *aProtocolConstants, uint_fast8_t aNumberOfBits, IRRawlenType aStartOffset=3)
 Decode pulse distance protocols for PulseDistanceWidthProtocolConstants. More...
 
void IRrecv::initBiphaselevel (uint_fast8_t aRCDecodeRawbuffOffset, uint16_t aBiphaseTimeUnit)
 
uint_fast8_t IRrecv::getBiphaselevel ()
 Gets the level of one time interval (aBiphaseTimeUnit) at a time from the raw buffer. More...
 
uint_fast8_t IRrecv::compare (uint16_t oldval, uint16_t newval)
 Compare two (tick) values for Hash decoder Use a tolerance of 20% to enable e.g. More...
 
bool IRrecv::decodeHash ()
 decodeHash - decode an arbitrary IR code. More...
 
bool IRrecv::decodeHashOld (decode_results *aResults)
 
bool IRrecv::checkHeader (PulseDistanceWidthProtocolConstants *aProtocolConstants)
 
void IRrecv::checkForRepeatSpaceTicksAndSetFlag (uint16_t aMaximumRepeatSpaceTicks)
 
bool IRrecv::checkForRecordGapsMicros (Print *aSerial)
 
static void IRrecv::printActiveIRProtocols (Print *aSerial)
 
bool IRrecv::printIRResultShort (Print *aSerial, bool aPrintRepeatGap=true, bool aCheckForRecordGapsMicros=true)
 Function to print values and flags of IrReceiver.decodedIRData in one line. More...
 
void IRrecv::printDistanceWidthTimingInfo (Print *aSerial, DistanceWidthTimingInfoStruct *aDistanceWidthTimingInfo)
 
uint8_t IRrecv::getMaximumMarkTicksFromRawData ()
 
uint8_t IRrecv::getMaximumSpaceTicksFromRawData ()
 
uint8_t IRrecv::getMaximumTicksFromRawData (bool aSearchSpaceInsteadOfMark)
 
uint32_t IRrecv::getTotalDurationOfRawData ()
 
void IRrecv::printIRSendUsage (Print *aSerial)
 Function to print values and flags of IrReceiver.decodedIRData in one line. More...
 
void IRrecv::printIRResultMinimal (Print *aSerial)
 Function to print protocol number, address, command, raw data and repeat flag of IrReceiver.decodedIRData in one short line. More...
 
void IRrecv::printIRResultRawFormatted (Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
 Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line. More...
 
void IRrecv::compensateAndPrintIRResultAsCArray (Print *aSerial, bool aOutputMicrosecondsInsteadOfTicks=true)
 Dump out the IrReceiver.decodedIRData.rawDataPtr->rawbuf[] to be used as C definition for sendRaw(). More...
 
void IRrecv::compensateAndStoreIRResultInArray (uint8_t *aArrayPtr)
 Store the decodedIRData to be used for sendRaw(). More...
 
void IRrecv::printIRResultAsCVariables (Print *aSerial)
 Print results as C variables to be used for sendXXX() More...
 
const char * IRrecv::getProtocolString ()
 
bool IRrecv::decode_old (decode_results *aResults)
 

Variables

const char string_Unknown[] PROGMEM = "UNKNOWN"
 
IRrecv IrReceiver
 The receiver instance. More...
 
struct irparams_struct irparams
 
uint_fast8_t sBiphaseDecodeRawbuffOffset
 
uint16_t sBiphaseCurrentTimingIntervals
 
uint_fast8_t sBiphaseUsedTimingIntervals
 
uint16_t sBiphaseTimeUnit
 
const char *const ProtocolNames []
 

Detailed Description

Macro Definition Documentation

◆ FNV_BASIS_32

#define FNV_BASIS_32   2166136261

used for decodeHash()

Definition at line 1039 of file IRReceive.hpp.

◆ FNV_PRIME_32

#define FNV_PRIME_32   16777619

used for decodeHash()

Definition at line 1038 of file IRReceive.hpp.

Function Documentation

◆ IRrecv() [1/3]

IRrecv::IRrecv ( )

Instantiate the IRrecv class.

Multiple instantiation is not supported.

Parameters
IRReceivePinArduino pin to use. No sanity check is made.

Definition at line 70 of file IRReceive.hpp.

◆ IRrecv() [2/3]

IRrecv::IRrecv ( uint_fast8_t  aReceivePin)

Definition at line 78 of file IRReceive.hpp.

◆ IRrecv() [3/3]

IRrecv::IRrecv ( uint_fast8_t  aReceivePin,
uint_fast8_t  aFeedbackLEDPin 
)

Instantiate the IRrecv class.

Multiple instantiation is not supported.

Parameters
aReceivePinArduino pin to use, where a demodulating IR receiver is connected.
aFeedbackLEDPinif 0, then take board specific FEEDBACK_LED_ON() and FEEDBACK_LED_OFF() functions

Definition at line 91 of file IRReceive.hpp.

◆ addMicrosToInternalTickCounter()

void IRrecv::addMicrosToInternalTickCounter ( uint16_t  aMicrosecondsToAddToInternalTickCounter)

Definition at line 416 of file IRReceive.hpp.

◆ addTicksToInternalTickCounter()

void IRrecv::addTicksToInternalTickCounter ( uint16_t  aTicksToAddToInternalTickCounter)

Definition at line 412 of file IRReceive.hpp.

◆ available()

bool IRrecv::available ( )

Returns true if IR receiver data is available.

Definition at line 502 of file IRReceive.hpp.

◆ begin()

void IRrecv::begin ( uint_fast8_t  aReceivePin,
bool  aEnableLEDFeedback = false,
uint_fast8_t  aFeedbackLEDPin = USE_DEFAULT_FEEDBACK_LED_PIN 
)

Initializes the receive and feedback pin.

Parameters
aReceivePinThe Arduino pin number, where a demodulating IR receiver is connected.
aEnableLEDFeedbackif true / ENABLE_LED_FEEDBACK, then let the feedback led blink on receiving IR signal
aFeedbackLEDPinif 0 / USE_DEFAULT_FEEDBACK_LED_PIN, then take board specific FEEDBACK_LED_ON() and FEEDBACK_LED_OFF() functions

Definition at line 290 of file IRReceive.hpp.

◆ bitreverse32Bit()

uint32_t bitreverse32Bit ( uint32_t  aInput)

Definition at line 274 of file IRProtocol.hpp.

◆ bitreverseOneByte()

uint8_t bitreverseOneByte ( uint8_t  aValue)

Definition at line 261 of file IRProtocol.hpp.

◆ checkForRecordGapsMicros()

bool IRrecv::checkForRecordGapsMicros ( Print *  aSerial)

Definition at line 1269 of file IRReceive.hpp.

◆ checkForRepeatSpaceTicksAndSetFlag()

void IRrecv::checkForRepeatSpaceTicksAndSetFlag ( uint16_t  aMaximumRepeatSpaceTicks)

Definition at line 1150 of file IRReceive.hpp.

◆ checkHeader()

bool IRrecv::checkHeader ( PulseDistanceWidthProtocolConstants aProtocolConstants)

Definition at line 1126 of file IRReceive.hpp.

◆ compare()

uint_fast8_t IRrecv::compare ( uint16_t  oldval,
uint16_t  newval 
)

Compare two (tick) values for Hash decoder Use a tolerance of 20% to enable e.g.

500 and 600 (NEC timing) to be equal

Returns
0 if newval is shorter, 1 if newval is equal, and 2 if newval is longer

Definition at line 1045 of file IRReceive.hpp.

◆ compensateAndPrintIRResultAsCArray()

void IRrecv::compensateAndPrintIRResultAsCArray ( Print *  aSerial,
bool  aOutputMicrosecondsInsteadOfTicks = true 
)

Dump out the IrReceiver.decodedIRData.rawDataPtr->rawbuf[] to be used as C definition for sendRaw().

Compensate received values by MARK_EXCESS_MICROS, like it is done for decoding! Print ticks in 8 bit format to save space. Maximum is 255*50 microseconds = 12750 microseconds = 12.75 ms, which hardly ever occurs inside an IR sequence. Recording of IRremote anyway stops at a gap of RECORD_GAP_MICROS (5 ms).

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.
aOutputMicrosecondsInsteadOfTicksOutput the (rawbuf_values * MICROS_PER_TICK) for better readability.

Definition at line 1717 of file IRReceive.hpp.

◆ compensateAndStoreIRResultInArray()

void IRrecv::compensateAndStoreIRResultInArray ( uint8_t *  aArrayPtr)

Store the decodedIRData to be used for sendRaw().

Compensate received values by MARK_EXCESS_MICROS, like it is done for decoding and store it in an array provided.

Maximum for uint8_t is 255*50 microseconds = 12750 microseconds = 12.75 ms, which hardly ever occurs inside an IR sequence. Recording of IRremote anyway stops at a gap of RECORD_GAP_MICROS (5 ms).

Parameters
aArrayPtrAddress of an array provided by the caller.

Definition at line 1773 of file IRReceive.hpp.

◆ decode()

bool IRrecv::decode ( )

The main decode function, attempts to decode the recently receive IR signal.

The set of decoders used is determined by active definitions of the DECODE_<PROTOCOL> macros. Results of decoding are stored in IrReceiver.decodedIRData.* like e.g. IrReceiver.decodedIRData.command.

Returns
false if no IR receiver data available, true if data available.

Definition at line 526 of file IRReceive.hpp.

◆ decode_old()

bool IRrecv::decode_old ( decode_results aResults)

Definition at line 1848 of file IRReceive.hpp.

◆ decodeHash()

bool IRrecv::decodeHash ( )

decodeHash - decode an arbitrary IR code.

Instead of decoding using a standard encoding scheme (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value.

The algorithm: look at the sequence of MARK and SPACE signals, and see if each one is shorter (0), the same length (1), or longer (2) than the previous MARK or SPACE. Hash the resulting sequence of 0's, 1's, and 2's to a 32-bit value. This will give a unique value for each different code (probably), for most code systems.

Use FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param Converts the raw code values into a 32-bit hash code. Hopefully this code is unique for each button. This isn't a "real" decoding, just an arbitrary value.

see: http://www.righto.com/2010/01/using-arbitrary-remotes-with-arduino.html

Definition at line 1072 of file IRReceive.hpp.

◆ decodeHashOld()

bool IRrecv::decodeHashOld ( decode_results aResults)

Definition at line 1097 of file IRReceive.hpp.

◆ decodePulseDistanceWidthData() [1/3]

bool IRrecv::decodePulseDistanceWidthData ( PulseDistanceWidthProtocolConstants aProtocolConstants,
uint_fast8_t  aNumberOfBits,
IRRawlenType  aStartOffset = 3 
)

Decode pulse distance protocols for PulseDistanceWidthProtocolConstants.

Returns
true if decoding was successful

Definition at line 954 of file IRReceive.hpp.

◆ decodePulseDistanceWidthData() [2/3]

bool IRrecv::decodePulseDistanceWidthData ( uint_fast8_t  aNumberOfBits,
IRRawlenType  aStartOffset,
uint16_t  aOneMarkMicros,
uint16_t  aOneSpaceMicros,
uint16_t  aZeroMarkMicros,
bool  aMSBfirst 
)

Decode pulse distance width protocols.

We only check the mark or space length of a 1, otherwise we always assume a 0!

We can have the following protocol timings PULSE_DISTANCE: Pause/spaces have different length and determine the bit value, longer space is 1. Pulses/marks can be constant, like NEC. PULSE_WIDTH: Pulses/marks have different length and determine the bit value, longer mark is 1. Pause/spaces can be constant, like Sony. PULSE_DISTANCE_WIDTH: Pulses/marks and pause/spaces have different length, often the bit length is constant, like MagiQuest. Can be decoded by PULSE_DISTANCE decoder.

Input is IrReceiver.decodedIRData.rawDataPtr->rawbuf[] Output is IrReceiver.decodedIRData.decodedRawData

Assume PULSE_DISTANCE if aOneMarkMicros == aZeroMarkMicros

Parameters
aNumberOfBitsNumber of bits to decode from decodedIRData.rawDataPtr->rawbuf[] array.
aStartOffsetOffset in decodedIRData.rawDataPtr->rawbuf[] to start decoding. Must point to a mark.
aOneMarkMicrosChecked if PULSE_WIDTH
aZeroMarkMicrosRequired for deciding if we have PULSE_DISTANCE.
aOneSpaceMicrosChecked if PULSE_DISTANCE.
aMSBfirstIf true send Most Significant Bit first, else send Least Significant Bit (lowest bit) first.
Returns
true If decoding was successful

Definition at line 702 of file IRReceive.hpp.

◆ decodePulseDistanceWidthData() [3/3]

bool IRrecv::decodePulseDistanceWidthData ( uint_fast8_t  aNumberOfBits,
IRRawlenType  aStartOffset,
uint16_t  aOneMarkMicros,
uint16_t  aZeroMarkMicros,
uint16_t  aOneSpaceMicros,
uint16_t  aZeroSpaceMicros,
bool  aMSBfirst 
)

Definition at line 762 of file IRReceive.hpp.

◆ decodePulseDistanceWidthDataStrict()

bool IRrecv::decodePulseDistanceWidthDataStrict ( uint_fast8_t  aNumberOfBits,
IRRawlenType  aStartOffset,
uint16_t  aOneMarkMicros,
uint16_t  aZeroMarkMicros,
uint16_t  aOneSpaceMicros,
uint16_t  aZeroSpaceMicros,
bool  aMSBfirst 
)

Definition at line 827 of file IRReceive.hpp.

◆ disableIRIn()

void IRrecv::disableIRIn ( )

Alias for stop().

Definition at line 441 of file IRReceive.hpp.

◆ enableIRIn()

void IRrecv::enableIRIn ( )

Alias for start().

Definition at line 386 of file IRReceive.hpp.

◆ end()

void IRrecv::end ( )

Alias for stop().

Definition at line 447 of file IRReceive.hpp.

◆ getBiphaselevel()

uint_fast8_t IRrecv::getBiphaselevel ( )

Gets the level of one time interval (aBiphaseTimeUnit) at a time from the raw buffer.

The RC5/6 decoding is easier if the data is broken into time intervals. E.g. if the buffer has mark for 2 time intervals and space for 1, successive calls to getBiphaselevel will return 1, 1, 0.

          _   _   _   _   _   _   _   _   _   _   _   _   _
    _____| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |_| |
           ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^   ^    Significant clock edge
          _     _   _   ___   _     ___     ___   _   - Mark

Data _____| |___| |_| |_| |_| |___| |___| |_| | - Data starts with a mark->space bit 1 0 0 0 1 1 0 1 0 1 1 - Space A mark to space at a significant clock edge results in a 1 A space to mark at a significant clock edge results in a 0 (for RC6) Returns current level [MARK or SPACE] or -1 for error (measured time interval is not a multiple of sBiphaseTimeUnit).

Definition at line 992 of file IRReceive.hpp.

◆ getMarkExcessMicros()

int getMarkExcessMicros ( )

Getter function for MARK_EXCESS_MICROS.

Definition at line 1260 of file IRReceive.hpp.

◆ getMaximumMarkTicksFromRawData()

uint8_t IRrecv::getMaximumMarkTicksFromRawData ( )

Definition at line 1397 of file IRReceive.hpp.

◆ getMaximumSpaceTicksFromRawData()

uint8_t IRrecv::getMaximumSpaceTicksFromRawData ( )

Definition at line 1407 of file IRReceive.hpp.

◆ getMaximumTicksFromRawData()

uint8_t IRrecv::getMaximumTicksFromRawData ( bool  aSearchSpaceInsteadOfMark)

Definition at line 1421 of file IRReceive.hpp.

◆ getProtocolString() [1/2]

const char * IRrecv::getProtocolString ( )

Definition at line 1835 of file IRReceive.hpp.

◆ getProtocolString() [2/2]

const char* getProtocolString ( decode_type_t  aProtocol)

Definition at line 96 of file IRProtocol.hpp.

◆ getTotalDurationOfRawData()

uint32_t IRrecv::getTotalDurationOfRawData ( )

Definition at line 1438 of file IRReceive.hpp.

◆ initBiphaselevel()

void IRrecv::initBiphaselevel ( uint_fast8_t  aRCDecodeRawbuffOffset,
uint16_t  aBiphaseTimeUnit 
)

Definition at line 970 of file IRReceive.hpp.

◆ initDecodedIRData()

void IRrecv::initDecodedIRData ( )

Is internally called by decode before calling decoders.

Must be used to setup data, if you call decoders manually.

Definition at line 474 of file IRReceive.hpp.

◆ IRReceiveTimerInterruptHandler()

void IRReceiveTimerInterruptHandler ( )

Definition at line 122 of file IRReceive.hpp.

◆ isIdle()

bool IRrecv::isIdle ( )

Returns status of reception.

Returns
true if no reception is on-going.

Definition at line 455 of file IRReceive.hpp.

◆ MATCH()

bool MATCH ( uint16_t  measured_ticks,
uint16_t  desired_us 
)

Definition at line 1185 of file IRReceive.hpp.

◆ MATCH_MARK()

bool MATCH_MARK ( uint16_t  measured_ticks,
uint16_t  desired_us 
)

Definition at line 1219 of file IRReceive.hpp.

◆ MATCH_SPACE()

bool MATCH_SPACE ( uint16_t  measured_ticks,
uint16_t  desired_us 
)

Definition at line 1253 of file IRReceive.hpp.

◆ matchMark()

bool matchMark ( uint16_t  aMeasuredTicks,
uint16_t  aMatchValueMicros 
)

Compensate for marks exceeded by demodulator hardware.

Returns
true, if values match

Definition at line 1193 of file IRReceive.hpp.

◆ matchSpace()

bool matchSpace ( uint16_t  aMeasuredTicks,
uint16_t  aMatchValueMicros 
)

Compensate for spaces shortened by demodulator hardware.

Returns
true, if values match

Definition at line 1227 of file IRReceive.hpp.

◆ matchTicks()

bool matchTicks ( uint16_t  aMeasuredTicks,
uint16_t  aMatchValueMicros 
)

Match function without compensating for marks exceeded or spaces shortened by demodulator hardware.

Returns
true, if values match Currently not used

Definition at line 1165 of file IRReceive.hpp.

◆ printActiveIRProtocols() [1/2]

void IRrecv::printActiveIRProtocols ( Print *  aSerial)
static

Definition at line 1294 of file IRReceive.hpp.

◆ printActiveIRProtocols() [2/2]

void printActiveIRProtocols ( Print *  aSerial)

Definition at line 1298 of file IRReceive.hpp.

◆ printDistanceWidthTimingInfo()

void IRrecv::printDistanceWidthTimingInfo ( Print *  aSerial,
DistanceWidthTimingInfoStruct aDistanceWidthTimingInfo 
)

Definition at line 1379 of file IRReceive.hpp.

◆ printIRResultAsCVariables()

void IRrecv::printIRResultAsCVariables ( Print *  aSerial)

Print results as C variables to be used for sendXXX()

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.

Definition at line 1796 of file IRReceive.hpp.

◆ printIRResultMinimal()

void IRrecv::printIRResultMinimal ( Print *  aSerial)

Function to print protocol number, address, command, raw data and repeat flag of IrReceiver.decodedIRData in one short line.

Does not print a Newline / does not end with println().

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.

Definition at line 1580 of file IRReceive.hpp.

◆ printIRResultRawFormatted()

void IRrecv::printIRResultRawFormatted ( Print *  aSerial,
bool  aOutputMicrosecondsInsteadOfTicks = true 
)

Dump out the timings in IrReceiver.decodedIRData.rawDataPtr->rawbuf[] array 8 values per line.

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.
aOutputMicrosecondsInsteadOfTicksOutput the (rawbuf_values * MICROS_PER_TICK) for better readability.

Definition at line 1624 of file IRReceive.hpp.

◆ printIRResultShort() [1/2]

bool IRrecv::printIRResultShort ( Print *  aSerial,
bool  aPrintRepeatGap = true,
bool  aCheckForRecordGapsMicros = true 
)

Function to print values and flags of IrReceiver.decodedIRData in one line.

Ends with println().

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.
aPrintRepeatGapIf true also print the gap before repeats.
aCheckForRecordGapsMicrosIf true, call CheckForRecordGapsMicros() which may do a long printout, which in turn may block the proper detection of repeats.*
Returns
true, if CheckForRecordGapsMicros() has printed a message, i.e. gap < 15ms (RECORD_GAP_MICROS_WARNING_THRESHOLD).

Definition at line 1370 of file IRReceive.hpp.

◆ printIRResultShort() [2/2]

void printIRResultShort ( Print *  aSerial,
IRData aIRDataPtr,
bool  aPrintRepeatGap 
)

Function to print decoded result and flags in one line.

A static function to be able to print data to send or copied received data. Ends with println().

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.
aIRDataPtrPointer to the data to be printed.
aPrintRepeatGapIf true also print the gap before repeats.

Definition at line 162 of file IRProtocol.hpp.

◆ printIRSendUsage()

void IRrecv::printIRSendUsage ( Print *  aSerial)

Function to print values and flags of IrReceiver.decodedIRData in one line.

do not print for repeats except IRDATA_FLAGS_IS_PROTOCOL_WITH_DIFFERENT_REPEAT. Ends with println(). !!!Attention: The result differs on a 8 bit or 32 bit platform!!!

Parameters
aSerialThe Print object on which to write, for Arduino you can use &Serial.

Definition at line 1455 of file IRReceive.hpp.

◆ read()

IRData * IRrecv::read ( )

If IR receiver data is available, returns pointer to IrReceiver.decodedIRData, else NULL.

Definition at line 509 of file IRReceive.hpp.

◆ registerReceiveCompleteCallback()

void IRrecv::registerReceiveCompleteCallback ( void(*)(void)  aReceiveCompleteCallbackFunction)

Sets the function to call if a protocol message has arrived.

Definition at line 346 of file IRReceive.hpp.

◆ restartAfterSend()

void IRrecv::restartAfterSend ( )

Restarts receiver after send.

Is a NOP if sending does not require a timer.

Definition at line 422 of file IRReceive.hpp.

◆ restartTimer() [1/2]

void IRrecv::restartTimer ( )

Definition at line 374 of file IRReceive.hpp.

◆ restartTimer() [2/2]

void IRrecv::restartTimer ( uint32_t  aMicrosecondsToAddToGapCounter)

Definition at line 399 of file IRReceive.hpp.

◆ restartTimerWithTicksToAdd()

void IRrecv::restartTimerWithTicksToAdd ( uint16_t  aTicksToAddToGapCounter)

Definition at line 407 of file IRReceive.hpp.

◆ resume()

void IRrecv::resume ( )

Restart the ISR (Interrupt Service Routine) state machine, to enable receiving of the next IR frame.

Internal counting of gap timing is independent of StateForISR and therefore independent of call time of resume().

Definition at line 463 of file IRReceive.hpp.

◆ setReceivePin()

void IRrecv::setReceivePin ( uint_fast8_t  aReceivePinNumber)

Sets / changes the receiver pin number.

Definition at line 313 of file IRReceive.hpp.

◆ start() [1/2]

void IRrecv::start ( )

Start the receiving process.

This configures the timer and the state machine for IR reception and enables the receive sample timer interrupt which consumes a small amount of CPU every 50 us.

Definition at line 356 of file IRReceive.hpp.

◆ start() [2/2]

void IRrecv::start ( uint32_t  aMicrosecondsToAddToGapCounter)

Configures the timer and the state machine for IR reception.

The tick counter value is already at 100 when decode() gets true, because of the 5000 us minimal gap defined in RECORD_GAP_MICROS.

Parameters
aMicrosecondsToAddToGapCounterTo compensate for the amount of microseconds the timer was stopped / disabled.

Definition at line 395 of file IRReceive.hpp.

◆ startWithTicksToAdd()

void IRrecv::startWithTicksToAdd ( uint16_t  aTicksToAddToGapCounter)

Definition at line 403 of file IRReceive.hpp.

◆ stop()

void IRrecv::stop ( )

Disables the timer for IR reception.

Definition at line 431 of file IRReceive.hpp.

◆ stopTimer()

void IRrecv::stopTimer ( )

Definition at line 435 of file IRReceive.hpp.

Variable Documentation

◆ irparams

struct irparams_struct irparams

Definition at line 59 of file IRReceive.hpp.

◆ IrReceiver

IRrecv IrReceiver

The receiver instance.

Definition at line 59 of file IRReceive.hpp.

◆ PROGMEM

const char* const ProtocolNames [] PROGMEM = "UNKNOWN"

Definition at line 46 of file IRProtocol.hpp.

◆ ProtocolNames

const char *const ProtocolNames
Initial value:
= { string_Unknown, string_PulseWidth, string_PulseDistance, string_Apple, string_Denon, string_JVC, string_LG, string_LG2,
string_NEC, string_NEC2, string_Onkyo, string_Panasonic, string_Kaseikyo, string_Kaseikyo_Denon, string_Kaseikyo_Sharp,
string_Kaseikyo_JVC, string_Kaseikyo_Mitsubishi, string_RC5, string_RC6, string_Samsung, string_SamsungLG, string_Samsung48,
string_Sharp, string_Sony
, string_BangOlufsen, string_BoseWave, string_Lego, string_MagiQuest, string_Whynter, string_FAST
}

Definition at line 81 of file IRProtocol.hpp.

◆ sBiphaseCurrentTimingIntervals

uint16_t sBiphaseCurrentTimingIntervals

Definition at line 966 of file IRReceive.hpp.

◆ sBiphaseDecodeRawbuffOffset

uint_fast8_t sBiphaseDecodeRawbuffOffset

Definition at line 965 of file IRReceive.hpp.

◆ sBiphaseTimeUnit

uint16_t sBiphaseTimeUnit

Definition at line 968 of file IRReceive.hpp.

◆ sBiphaseUsedTimingIntervals

uint_fast8_t sBiphaseUsedTimingIntervals

Definition at line 967 of file IRReceive.hpp.